This interface is known as ifRoDateTime in some firmware versions.
Implemented By
Supported Methods
- Mark() as Void
- ToLocalTime() as Void
- GetTimeZoneOffset() as Integer
- AsSeconds() as Integer
- FromSeconds(numSeconds as Integer) as Void
- ToISOString() as String
- FromISO8601String(dateString as String) as Void
- AsDateString(format as String) as String
- AsDateStringNoParam() as String
- GetWeekday() as String
- GetYear() as Integer
- GetMonth() as Integer
- GetDayOfMonth() as Integer
- GetHours() as Integer
- GetMinutes() as Integer
- GetSeconds() as Integer
- GetMilliseconds() as Integer
- GetLastDayOfMonth() as Integer
- GetDayOfWeek() as Integer
Description of Methods
Mark() as Void
Set the date/time value to the current UTC date and time.
Note: roDateTime objects are automatically Marked on creation.
ToLocalTime() as Void
Offsets the date/time value from an assumed UTC date/time to a local date/time using the system time zone setting.
This function is not idempotent, and multiple calls will do multiple timezone adjustments to the time yielding an incorrect result.
GetTimeZoneOffset() as Integer
Returns the offset in minutes from the system time zone to UTC.
For example, if the system time zone is in PDT / UTC-7 the value returned would be 420.
Note: the time zone offset is returned for the current date/time, regardless of the object's date/time value.
This function is available in firmware 6.2 or later.
AsSeconds() as Integer
Returns the date/time as the number of seconds from the Unix epoch (00:00:00 1/1/1970 GMT).
FromSeconds(numSeconds as Integer) as Void
Set the date/time value using the number of seconds from the Unix epoch.
ToISOString() as String
Return an ISO 8601 representation of the date/time value, e.g. "2015-01-27T13:21:58Z".
This function is available in firmware 6.2 or later.
FromISO8601String(dateString as String) as Void
Set the date/time using a string in the ISO 8601 format. For example "YYYY-MM-DD HH:MM:SS" e.g "2009-01-01 01:00:00.000" or "2009-01-01T01:00:00.000". Note that this function is unaware of the local time zone, so these time formats are effectively UTC even though the ISO 8601 spec says they should be in local time. The above formats are also the only formats recognized by this function, even though the ISO 8601 spec contains other valid formats.
AsDateString(format as String) as String
Returns the date/time as a formatted string in one of the following formats:
format | example |
---|---|
long-date | Tuesday October 9, 2012 |
short-weekday | Tue October 9, 2012 |
no-weekday | October 9, 2012 |
short-month | Tuesday Oct 9, 2012 |
short-month-short-weekday | Tue Oct 9, 2012 |
short-month-no-weekday | Oct 9, 2012 |
short-date | 10/9/12 |
short-date-dashes | 10-9-12 |
Note that day names, month names, separators, and order of fields may vary depending on the current locale.
The order of the fields in both short-date formats is changed depending on the current locale:
locale | field order |
---|---|
Canada | YYYY/MM/DD |
United States | MM/DD/YY |
UK and rest of world | DD/MM/YY |
AsDateStringNoParam() as String
Same as AsDateString("long-date").
GetWeekday() as String
Returns the day of the week as a String (e.g. "Monday").
Note: this function always returns the canonical English day of week names, regardless of the current locale. For a locale-independent index, see GetDayOfWeek().
GetYear() as Integer
Returns the date/time value's year as an Integer, e.g. 2015.
GetMonth() as Integer
Returns the date/time value's month as an Integer (1=Jan, 12=Dec).
GetDayOfMonth() as Integer
Returns the date/time value's day of the month as an Integer (1-31).
GetHours() as Integer
Returns the date/time value's hour within the day as an Integer (0-23).
GetMinutes() as Integer
Returns the date/time value's minute within the hour as an Integer (0-59).
GetSeconds() as Integer
Returns the date/time value's second within the minute as an Integer (0-59).
GetMilliseconds() as Integer
Returns the date/time value's millisecond within the second as an Integer (0-999).
GetLastDayOfMonth() as Integer
Returns the date/time value's last day of the month as an Integer (28-31).
GetDayOfWeek() as Integer
Returns the date/time value's day of week as an Integer (Sunday=0, Monday=1, ..., Saturday=6).
This function is available in firmware 6.2 or later.