altova::DateTime
This class enables you to process XML attributes or elements that have date and time types, such as xs:dateTime.
Constructors
Name | Description |
---|---|
DateTime() | Initializes a new instance of the DateTime class to 12:00:00 midnight, January 1, 0001. |
DateTime(__int64 value, short timezone) | Initializes a new instance of the DateTime class. The value parameter represents the number of ticks (100-nanosecond intervals) that have elapsed since 12:00:00 midnight, January 1, 0001. |
DateTime(int year, unsigned char month, unsigned char day, unsigned char hour, unsigned char minute, double second) | Initializes a new instance of the DateTime class to the year, month, day, hour, minute, and second supplied as argument.
|
DateTime(int year, unsigned char month, unsigned char day, unsigned char hour, unsigned char minute, double second, short timezone) | Initializes a new instance of the DateTime class to the year, month, day, hour, minute, second and timezone supplied as argument. The timezone is expressed in minutes and can be positive or negative. For example, the timezone "UTC-01:00" is expressed as "-60".
|
Methods
Name | Description |
---|---|
unsigned char Day() const | Returns the day of month of the current DateTime object. The return values range from 1 through 31. |
int DayOfYear() const | Returns the day of year of the current DateTime object. The return values range from 1 through 366. |
bool HasTimezone() const | Returns Boolean true if the current DateTime object has a timezone defined; false otherwise. |
unsigned char Hour() const | Returns the hour of the current DateTime object. The return values range from 0 through 23. |
static bool IsLeapYear(int year) | Returns Boolean true if the year of the DateTime class is a leap year; false otherwise. |
unsigned char Minute() const | Returns the minute of the current DateTime object. The return values range from 0 through 59. |
unsigned char Month() const | Returns the month of the current DateTime object. The return values range from 1 through 12. |
__int64 NormalizedValue() const | Returns the value of the DateTime object expressed as the Coordinated Universal Time (UTC). |
double Second() const | Returns the second of the current DateTime object. The return values range from 0 through 59. |
void SetTimezone(short tz) | Sets the timezone of the current DateTime object to the timezone value supplied as argument. The tz argument is expressed in minutes and can be positive or negative. |
short Timezone() const | Returns the timezone, in minutes, of the current DateTime object. Before using this method, make sure that the object actually has a timezone, by calling the HasTimezone() method. |
__int64 Value() const | Returns the value of the DateTime object, expressed in the number of ticks (100-nanosecond intervals) that have elapsed since 12:00:00 midnight, January 1, 0001. |
int Weekday() const | Returns the day of week of the current DateTime object, as an integer. Values range from 0 through 6, where 0 is Monday (ISO-8601). |
int Weeknumber() const | Returns the number of week in the year of the current DateTime object. The return values are according to ISO-8601. |
int WeekOfMonth() const | Returns the number of week in the month of the current DateTime object. The return values are according to ISO-8601. |
int Year() const | Returns the year of the current DateTime object. |
Example
void Example() |