Player APIs (BrightScript & Ja...
...
Object Reference
Date and Time Objects
roSystemTime
11min
this object provides the ability to read and write the time stored in the real time clock (rtc) it can also be used to read and write the time zone setting the javascript equivalent is systemtime docid\ pwlrn rjihdhgwl2tbwc0 dates up to january 1, 2038 are supported ifuserdata setuserdata(user data as object) sets the user data that will be returned when events are raised getuserdata() as object returns the user data that has previously been set via setuserdata() it will return invalid if no data has been set ifmessageport setport(port as romessageport) posts messages of the type ronetworktimeevent to the attached message port ifsystemtime getlocaldatetime() as rodatetime returns the current time from the rtc (modulated using the current time zone) as an rodatetime instance getutcdatetime() as rodatetime returns the current time from the rtc (modulated using the utc/gmt time zone) as an rodatetime instance getzonedatetime(timezone name as string) as object returns the current time from the rtc (modulated using the specified time zone) as an rodatetime instance supported time zones are listed below setlocaldatetime(local datetime as rodatetime) as boolean specifies a new time for the rtc using the current time zone setutcdatetime(utc datetime as rodatetime) as boolean specifies a new time for the rtc using the utc/gmt time zone gettimezone() as string returns the current time zone setting of the player a posix value is appended to the beginning of the string if the time zone has been set using the posix format settimezone(zone name as string) as boolean specifies a new time zone setting for the player (supported time zones are listed below) alternatively, a posix formatted time zone can be applied by appending a posix value to the beginning of the string the following code specifies a posix formatted time zone t = createobject("rosystemtime") t settimezone("posix\ gmt 0bst 1,m3 5 0/1 00,m10 5 0/2 00") isvalid() as boolean returns true if the system time is set to a valid value the time can be set from the rtc or with ntp getlastnetworktimeresult() as roassociativearray returns an associative array containing information about the last attempt to set the time via the network success timestamp a value indicating when the clock was last set successfully via the network this value is zero if the clock has never been set successfully via the network attempt timestamp a value indicating when the last attempt was made to set the clock via the network this value is zero if no attempt has been made yet failure reason if the last attempt to set the clock via the network failed, this string will contain an error message if the last attempt was successful, this string will be empty in this associative array, "timestamp" refers to the number of seconds since the player booted this value can be compared against the total uptime of the player, which is retrieved by calling uptime(0) supported time zones the following are supported system time zones (this list does not apply to posix formatted time zones) est us eastern time cst us central time mst us mountain time pst us pacific time akst alaska time hst hawaii aleutian time with no daylight savings (hawaii) hst1 hawaii aleutian time with daylight saving mst1 us mt without daylight saving time (arizona) est1 us et without daylight saving time (east indiana) ast atlantic time cst2 mexico (mexico city) mst2 mexico (chihuahua) pst2 mexico (tijuana) brt brazil time (sao paulo) nst newfoundland time azot azores time gmtbst london/dublin time wet western european time cet central european time eet eastern european time msk moscow time samt delta time zone (samara) yekt echo time zone (yekaterinburg) ist indian standard time npt nepal time omst foxtrot time zone (omsk) jst japanese standard time cxt christmas island time (australia) awst australian western time awst1 australian western time without daylight saving time acst australian central standard time (cst) with daylight saving time acst1 darwin, australia/darwin, and australian central standard time (cst) without daylight saving time aest australian eastern time with daylight saving time aest1 australian eastern time without daylight saving time (brisbane) nft norfolk (island) time (australia) nzst new zealand time (auckland) chast , fiji time, , fiji, pacific/fiji, yankee time zone (fiji) sst x ray time zone (pago pago) gmt greenwich mean time gmt 1 1 hour behind greenwich mean time gmt 2 2 hours behind greenwich mean time gmt 3 3 hours behind greenwich mean time gmt 3 30 3 5 hours behind greenwich mean time gmt 4 4 hours behind greenwich mean time gmt 4 30 4 5 hours behind greenwich mean time gmt 5 5 hours behind greenwich mean time gmt 6 6 hours behind greenwich mean time gmt 7 7 hours behind greenwich mean time gmt 8 8 hours behind greenwich mean time gmt 9 9 hours behind greenwich mean time gmt 9 30 9 5 hours behind greenwich mean time gmt 10 10 hours behind greenwich mean time gmt 11 11 hours behind greenwich mean time gmt 12 12 hours behind greenwich mean time gmt 13 13 hours behind greenwich mean time gmt 14 14 hours behind greenwich mean time gmt+1 1 hour ahead of greenwich mean time gmt+2 2 hours ahead of greenwich mean time gmt+3 3 hours ahead of greenwich mean time gmt+3 30 3 5 hours ahead of greenwich mean time gmt+4 4 hours ahead of greenwich mean time gmt+4 30 4 5 hours ahead of greenwich mean time gmt+5 5 hours ahead of greenwich mean time gmt+5 30 5 5 hours ahead of greenwich mean time gmt+6 6 hours ahead of greenwich mean time gmt+6 30 6 5 hours ahead of greenwich mean time gmt+7 7 hours ahead of greenwich mean time gmt+7 30 7 5 hours ahead of greenwich mean time gmt+8 8 hours ahead of greenwich mean time gmt+8 30 8 5 hours ahead of greenwich mean time gmt+9 9 hours ahead of greenwich mean time gmt+9 30 9 5 hours ahead of greenwich mean time gmt+10 10 hours ahead of greenwich mean time gmt+10 30 10 5 hours ahead of greenwich mean time gmt+11 11 hours ahead of greenwich mean time gmt+11 30 11 5 hours ahead of greenwich mean time gmt+12 12 hours ahead of greenwich mean time gmt+12 30 12 5 hours ahead of greenwich mean time gmt+13 13 hours ahead of greenwich mean time gmt+14 14 hours ahead of greenwich mean time