Date/Time class. More...
#include <datetime.h>
Public Member Functions | |
Operations | |
| void | set_null () |
| void | set_date (int year, int month, int day, int hour=0, int minute=0, int seconds=0, int nanoseconds=0, TimeZone timezone=utc_timezone) |
| void | set_year (int year) |
| void | set_month (int month) |
| void | set_day (int day) |
| void | set_hour (int hour) |
| void | set_minutes (int minutes) |
| void | set_seconds (int seconds) |
| void | set_nanoseconds (int nanoseconds) |
| void | set_timezone (TimeZone timezone) |
| DateTime & | add_years (int years) |
| DateTime & | add_days (int days) |
| DateTime & | add_months (int months) |
| DateTime | to_utc () const |
| DateTime | to_local () const |
| int64_t | to_ticks () const |
| Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC. More... | |
| std::string | to_long_date_string () const |
| Mon Mar 3 2007. More... | |
| std::string | to_short_date_string () const |
| yyyy-mm-dd More... | |
| std::string | to_short_datetime_string () const |
| yyyy-mm-dd hh:mm:ss More... | |
| std::string | to_long_time_string () const |
| hh:mm:ss More... | |
| std::string | to_short_time_string () const |
| hh:mm More... | |
| std::string | to_string () const |
| Mon Feb 3 12:32:54 2008. More... | |
| bool | operator< (const DateTime &other) const |
| bool | operator<= (const DateTime &other) const |
| bool | operator> (const DateTime &other) const |
| bool | operator>= (const DateTime &other) const |
| bool | operator== (const DateTime &other) const |
| bool | operator!= (const DateTime &other) const |
Construction | |
| enum | TimeZone { local_timezone, utc_timezone } |
| DateTime () | |
| Constructs a date/time object. More... | |
| DateTime (int year, int month, int day, int hour=0, int minute=0, int seconds=0, int nanoseconds=0, TimeZone timezone=utc_timezone) | |
| ~DateTime () | |
| static DateTime | get_current_local_time () |
| Get current system time in local time zone. More... | |
| static DateTime | get_current_utc_time () |
| Get current system time in UTC. More... | |
| static DateTime | get_local_time_from_ticks (int64_t ticks) |
| Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in the local time zone. More... | |
| static DateTime | get_utc_time_from_ticks (int64_t ticks) |
| Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in UTC. More... | |
| static DateTime | from_short_date_string (const std::string &value) |
Attributes | |
| bool | is_null () const |
| unsigned short | get_year () const |
| unsigned char | get_month () const |
| Returns the month number in range 1-12. More... | |
| unsigned char | get_day () const |
| unsigned char | get_hour () const |
| unsigned char | get_minutes () const |
| unsigned char | get_seconds () const |
| unsigned int | get_nanoseconds () const |
| TimeZone | get_timezone () const |
| unsigned char | get_week () const |
| Returns the ISO 8601 week number of the date. More... | |
| int | get_difference_in_days (const DateTime &other) const |
| Returns the difference in days between two dates. This function is only accurate for the next few millenniums. More... | |
| unsigned int | get_day_of_week () const |
| Get the day of the week. More... | |
| static int | get_days_in_month (int month, int year) |
| Returns the number of days in the given month. More... | |
Date/Time class.