Aspose::Cells::Date struct

Date struct

Represents a date and time.

struct Date

Methods

MethodDescription
AddDays(double days) constReturns a new Date that adds the specified number of days.
AddHours(double hours) constReturns a new Date that adds the specified number of hours.
AddMilliseconds(double ms) constReturns a new Date that adds the specified number of milliseconds.
AddMinutes(double minutes) constReturns a new Date that adds the specified number of minutes.
AddMonths(int32_t months) constReturns a new Date that adds the specified number of months.
AddSeconds(double seconds) constReturns a new Date that adds the specified number of seconds.
AddYears(int32_t years) constReturns a new Date that adds the specified number of years.
DayOfWeek() constGets the day of the week for this date.
static FromEpochMillisecondsUTC(int64_t ms)Creates a Date from Unix epoch milliseconds (UTC).
static Now()Gets the current local date and time.
static NowUTC()Gets the current UTC date and time.
operator!=(const Date& other) constDetermines whether two Date instances represent different points in time.
operator+(const Duration& ts) constAdds a time interval to the current Date.
operator-(const Duration& ts) constSubtracts a time interval from the current Date.
operator-(const Date& other) constComputes the difference between two Date instances.
operator<(const Date& other) constDetermines whether this instance is earlier than another Date.
operator<=(const Date& other) constDetermines whether this instance is earlier than or equal to another Date.
operator==(const Date& other) constDetermines whether two Date instances represent the same point in time.
operator>(const Date& other) constDetermines whether this instance is later than another Date.
operator>=(const Date& other) constDetermines whether this instance is later than or equal to another Date.
static Parse(const U16String& str)Parses a string into a Date using default format rules.
static Parse(const U16String& str, const U16String& format)Parses a string into a Date using a specified format.
ToEpochMillisecondsUTC() constConverts this Date to Unix epoch time in milliseconds (UTC).
ToLocal() constConverts this Date to local system time.
ToString() constConverts this Date to its default string representation.
ToString(const U16String& format) constConverts this Date to a string using the specified format.
ToUTC() constConverts this Date to Coordinated Universal Time (UTC).

Fields

FieldDescription
dateKindSpecifies whether the time is local, UTC, or unspecified. Default value is Unspecified.
dayDay component (1-31).
hourHour component (0-23).
millisecondMillisecond component (0-999).
minuteMinute component (0-59).
monthMonth component (1-12).
secondSecond component (0-59).
yearYear component (1-9999).

See Also