#include <lib_datetimeparser.h>
Class to parse and create date time strings.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
Example:
GePrint(sDateFormat +
" " + sTimeFormat);
void GePrint(const maxon::String &str)
Definition: ge_autoptr.h:37
Definition: c4d_string.h:41
Represents a date and time.
Definition: customgui_datetime.h:39
◆ DateTimeParser()
◆ ~DateTimeParser()
◆ Alloc()
Allocates a date time parser. Destroy the allocated date time parser with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated date time parser, or nullptr if the allocation failed.
◆ Free()
Destructs date time parsers allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | dtp | The date time parser to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ ParseString()
Parses a date time string.
- Parameters
-
[in] | str | The string to parse. |
[in] | result | Assigned the parsed result. |
[in] | mode | The date time mode: DATETIMEPARSERMODE |
- Returns
- true if successful, otherwise false.
◆ MakeString()
Creates a date time string, e.g. "12:24:05" or "2011-08-23".
- Parameters
-
[in] | dt | The date time to create the string from. |
[in] | mode | The date time mode: DATETIMEPARSERMODE |
- Returns
- The date time string.
◆ SetFormatString()
Sets the formating of the time string.
- Parameters
-
[in] | sFormat | The formating string, e.g. "HH:MM:SS" for time and "YYYY-MM-DD" for the date. |
[in] | mode | The date time mode: DATETIMEPARSERMODE |
◆ GetFormatString()
Retrieves the current date time formating string.
- Parameters
-
- Returns
- The formating string, e.g. "HH:MM:SS" for time and "YYYY-MM-DD" for the date.