mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibCore: Add DateTime::to_string()
This is just the contents of to_deprecated_string() with errors propagated. to_deprecated_string() is now implemented using to_string().
This commit is contained in:
parent
7dfe1f9f8f
commit
8dd0038f47
2 changed files with 52 additions and 44 deletions
|
@ -31,6 +31,7 @@ public:
|
|||
bool is_leap_year() const;
|
||||
|
||||
void set_time(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
|
||||
ErrorOr<String> to_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const;
|
||||
DeprecatedString to_deprecated_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const;
|
||||
|
||||
static DateTime create(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue