Player APIs (BrightScript & Ja...
...
Object Reference
Date and Time Objects

roDateTime

15min
this object is used to represent an instant in time at the time of its creation, a new object represents zero seconds the javascript equivalent is "date" ifdatetime getdayofweek() as integer getday() as integer getmonth() as integer getyear() as integer gethour() as integer getminute() as integer getsecond() as integer getmillisecond() as integer setday(day as integer) as void setmonth(month as integer) as void setyear(year as integer) as void sethour(hour as integer) as void setminute(minute as integer) as void setsecond(second as integer) as void setmillisecond(millisecond as integer) as void addseconds(seconds as integer) as void subtractseconds(seconds as integer) as void addmilliseconds(milliseconds as integer) as void subtractmilliseconds(milliseconds as integer) as void normalize() as boolean checks that all the fields supplied are correct this function fails if the values are out of bounds toisostring() as string returns the current rodatetime value as an iso 8601 basic formatted string hyphens for date and colons for time are omitted, and a comma is used to separate seconds from milliseconds for example, the iso 8601 standard "2014 05 29t12 30 00 100" would be formatted as "20140529t123000,100" this method returns an empty string if the year is less than 1970 or greater than 2100 since a new, un configured rodatetime object lies outside the acceptable range, it will also return an empty string fromisostring(date time as string) as boolean sets the value of the rodatetime object using an iso 8601 basic formatted string hyphens for date and colons for time are omitted, and either a period or comma can be used to separate seconds from milliseconds the iso 8601 standard "2014 05 29t12 30 00 100" could, for example, be formatted as either "20140529t123000,100" or "20140529t123000 100" this method will return false (indicating that it has not affected changes to the rodatetime object) if the string is formatted incorrectly or if the date passed is outside the range of january 1, 1970 and december 31, 2100 tosecondssinceepoch() as integer returns the number of seconds that have elapsed since midnight on january 1, 1970, as represented by the rodatetime instance (not the system time) fromsecondssinceepoch(seconds as integer) as boolean populates the rodatetime instance with the specified number of seconds since midnight on january 1, 1970 getstring() as string ifstring getstring() as string returns the current date using a sortable date format "yyyy/mm/dd hh\ mm\ ss sss"