|
PLCnext API Documentation
20.0.0.24462
|
The class contains date and time informations. More...
#include <DateTime.hpp>
Public Member Functions | |
| DateTime (void) | |
| Constructs an zero'ed DateTime instance. More... | |
| DateTime (int64 ticks, DateTimeKind kind=DateTimeKind::Unspecified) | |
| Constructs an DateTime instance. More... | |
| DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, DateTimeKind kind=DateTimeKind::Unspecified) | |
| Initializes a new instance of the T:System.DateTime structure to the specified year, month, day, hour, minute, second, and millisecond. More... | |
| DateTime (const DateTime &arg)=default | |
| The default copy constructor. More... | |
| DateTime & | operator= (const DateTime &arg)=default |
| The default assignment operator. More... | |
| ~DateTime (void)=default | |
| Destructs this instance and frees all resources. More... | |
| bool | operator== (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| bool | operator!= (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| bool | operator> (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| bool | operator< (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| bool | operator>= (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| bool | operator<= (const DateTime &arg) const |
| Compares the ticks of this instance to arg . More... | |
| int64 | GetTicks (void) const |
| Gets the number of ticks that represent the date and time of this instance. More... | |
| DateTimeKind | GetKind (void) const |
| Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither. More... | |
| int | GetYear (void) const |
| Gets the year component of the date represented by this instance. More... | |
| int | GetMonth (void) const |
| Gets the month component of the date represented by this instance. More... | |
| int | GetDay (void) const |
| Gets the day of the month component of the date represented by this instance. More... | |
| int | GetHour (void) const |
| Gets the hour component of the date represented by this instance. More... | |
| int | GetMinute (void) const |
| Gets the minute component of the date represented by this instance. More... | |
| int | GetSecond (void) const |
| Gets the second component of the date represented by this instance. More... | |
| int | GetMillisecond (void) const |
| Gets the millisecond component of the date represented by this instance. More... | |
| int | GetMicrosecond (void) const |
| Gets the microsecond component of the date represented by this instance. More... | |
| time_t | ToUnixTime (void) const |
| Converts this instance to unix time (UTC). More... | |
| uint64 | ToUnixMicrosecondTicks (void) const |
| Converts this instance to unix time (UTC) in microseconds. More... | |
| int64 | ToUnixTimeMicroseconds (void) const |
| Converts this instance to unix time (UTC) in microseconds. More... | |
| uint64 | ToBinary (void) const |
| Converts this instance to a binary representation. More... | |
| int64 | ToOpcUaTime (void) const |
| Converts this instance to OPC time (UTC). More... | |
| String | ToIso8601String (void) const |
| Converts this instance to an ISO8601 string . More... | |
Static Public Member Functions | |
| static DateTime | Now (void) |
| Gets the current time as DateTime, expressed as the UTC time. More... | |
| static DateTime | FromUnixTime (time_t unixTime) |
| Creates a DateTime from the as argument passed unix time. More... | |
| static DateTime | FromUnixMicrosecondTicks (uint64 microseconds) |
| Creates a DateTime from the as argument passed unix time in microseconds. More... | |
| static DateTime | FromUnixTimeMicroseconds (int64 microseconds) |
| Creates a DateTime from the as argument passed unix time in microseconds. More... | |
| static DateTime | FromOpcUaTime (int64 opcUaTime) |
| Creates a DateTime from the argument passed in OpcUA time. More... | |
| static DateTime | FromIso8601String (const String &value) |
| Creates a DateTime from the as argument passed ISO8601 string. More... | |
| static DateTime | FromBinary (uint64 data) |
| Creates a DateTime from the as argument passed binary representation. More... | |
| static bool | IsLeapYear (int year) |
| Returns an indication whether the specified year is a leap year. More... | |
Static Public Attributes | |
| static const int64 | MinTicks = 0 |
| The minimal tick count. More... | |
| static const int64 | MaxTicks = daysTo10000 * ticksPerDay - 1 |
| The maximal tick count. More... | |
The class contains date and time informations.
The granularity of the time values is 100 nanosecods units called ticks. The origin of the dates is 01.01.0001 at 00:00:00. Thus a particular date and time values is the number of ticks from 01.01.0001 at 00:00:00 o'clock.
The implementation and internal representation complies to the .NET DateTime class, see https://docs.microsoft.com/de-de/dotnet/api/system.datetime?view=netframework-4.7.2.
|
explicit |
| Arp::DateTime::DateTime | ( | int | year, |
| int | month, | ||
| int | day, | ||
| int | hour, | ||
| int | minute, | ||
| int | second, | ||
| int | millisecond, | ||
| int | microsecond, | ||
| DateTimeKind | kind = DateTimeKind::Unspecified |
||
| ) |
Initializes a new instance of the T:System.DateTime structure to the specified year, month, day, hour, minute, second, and millisecond.
| year | The year (1 through 9999). |
| month | The month (1 through 12). |
| day | The day (1 through the number of days in month). |
| hour | The hours (0 through 23). |
| minute | The minutes (0 through 59). |
| second | The seconds (0 through 59). |
| millisecond | The milliseconds (0 through 999). |
| microsecond | The milliseconds (0 through 999). |
| kind | The DateTimeKind to initialize the DateTime with. |
|
default |
The default copy constructor.
| arg | The argument to copy. |
|
default |
Destructs this instance and frees all resources.
|
static |
| int Arp::DateTime::GetDay | ( | void | ) | const |
Gets the day of the month component of the date represented by this instance.
| int Arp::DateTime::GetHour | ( | void | ) | const |
Gets the hour component of the date represented by this instance.
| int Arp::DateTime::GetMicrosecond | ( | void | ) | const |
Gets the microsecond component of the date represented by this instance.
| int Arp::DateTime::GetMillisecond | ( | void | ) | const |
Gets the millisecond component of the date represented by this instance.
| int Arp::DateTime::GetMinute | ( | void | ) | const |
Gets the minute component of the date represented by this instance.
| int Arp::DateTime::GetMonth | ( | void | ) | const |
Gets the month component of the date represented by this instance.
| int Arp::DateTime::GetSecond | ( | void | ) | const |
Gets the second component of the date represented by this instance.
| int Arp::DateTime::GetYear | ( | void | ) | const |
Gets the year component of the date represented by this instance.
|
static |
Returns an indication whether the specified year is a leap year.
| year | A 4-digit year. |
true if year is a leap year; otherwise, false.
|
static |
Gets the current time as DateTime, expressed as the UTC time.
The default assignment operator.
| arg | The argument to assign to this instance. |
| uint64 Arp::DateTime::ToBinary | ( | void | ) | const |
Converts this instance to a binary representation.
| String Arp::DateTime::ToIso8601String | ( | void | ) | const |
Converts this instance to an ISO8601 string .
| int64 Arp::DateTime::ToOpcUaTime | ( | void | ) | const |
Converts this instance to OPC time (UTC).
| uint64 Arp::DateTime::ToUnixMicrosecondTicks | ( | void | ) | const |
Converts this instance to unix time (UTC) in microseconds.
| time_t Arp::DateTime::ToUnixTime | ( | void | ) | const |
Converts this instance to unix time (UTC).
| int64 Arp::DateTime::ToUnixTimeMicroseconds | ( | void | ) | const |
Converts this instance to unix time (UTC) in microseconds.
|
static |
The maximal tick count.
The maximal tick count is equivalent to 23:59:59.9999999 UTC, December 31, 9999.
|
static |
The minimal tick count.
The minimal tick count is zero and is equivalent to 00:00:00.0000000 UTC, January 1, 0001.
1.8.13