Skip to reading
PCA Script Programming

now_unix()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Code example
now_unix()

Read the system clock in whole Unix seconds.

Returns: Integer seconds since the Unix epoch.

Code example
now_unix()

The system clock can be adjusted; do not confuse it with a monotonic frame timer.

date_time_now()#

Code example
date_time_now(utc = false)

Read the current calendar date/time as a dictionary.

Returns: Dictionary including year, month, day, weekday, hour, minute, second and dst.

Code example
date_time_now(true)

date_time_string()#

Code example
date_time_string(utc = false, use_space = true)

Format the current system date/time.

Returns: Text.

Code example
date_time_string(false, true)

unix_to_date_time()#

Code example
unix_to_date_time(timestamp, reserved?)

Convert Unix seconds to a calendar dictionary.

Returns: Dictionary.

Code example
unix_to_date_time(0)

The validator accepts a second argument, but this VM forwards only the timestamp to the conversion. Do not rely on that argument for a timezone change.

Page 73 of 357Permalink
Go to page