SysTime ()


hschir

Recommended Posts

Posted

How do I display the system time on a DC page ?

Posted

dateTime.systemTime() gives you the current system time (local to the browser). This is in milliseconds since 1970 (javascript standard). You can then format with one of the following:

dateTime.printDate(x): prints the date portion

dateTime.printTime(x, ms, sec): prints the time portion. If ms is false, it doesn't print milliseconds. If secs is false, it doesn't print seconds either.

dateTime.printDateTime(x, ms): prints the date and the time with seconds. If ms is false, it doesn't print milliseconds

For example:

dateTime.printDateTime(dateTime.systemTime(), false)

That would go in the expression for a variable value control.

You can change the ordering of dates to day month year by doing:

dateTime.dateFormat = "dmy"

in a Load event for a page.

Archived

This topic is now archived and is closed to further replies.