1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibCore: Moved cal.cpp functions to DateTime

This commit is contained in:
rhin123 2020-03-10 16:41:01 -05:00 committed by Andreas Kling
parent 46a897b59b
commit 08a30a4961
3 changed files with 75 additions and 23 deletions

View file

@ -42,9 +42,15 @@ public:
unsigned hour() const { return m_hour; }
unsigned minute() const { return m_minute; }
unsigned second() const { return m_second; }
unsigned weekday() const;
unsigned days_in_month() const;
unsigned day_of_year() const;
bool is_leap_year() const;
void set_time(unsigned year, unsigned month = 1, unsigned day = 0, unsigned hour = 0, unsigned minute = 0, unsigned second = 0);
String to_string(const String& format = "%Y-%m-%d %H:%M:%S") const;
static DateTime create(unsigned year, unsigned month = 1, unsigned day = 0, unsigned hour = 0, unsigned minute = 0, unsigned second = 0);
static DateTime now();
static DateTime from_timestamp(time_t);