Name
GetTimestamp -- get timestamp (V7.0)
Synopsis
s = GetTimestamp([type])
Function
This function returns a timestamp. The time is returned in seconds as a fractional number, allowing for sufficient precision. The type parameter allows you to specify what kind of timestamp you'd like to get. This can be one of the following:

#TIMESTAMP_START:
Return the time in seconds since Hollywood was started. This is the default.

#TIMESTAMP_UNIX:
Return the time that has elapsed since the Unix epoch which started on January 1st, 1970, 00:00:00 UTC. Note that this depends on the system clock so there could be problems if the system clock is changed while your script is running. If you want to be independent of the system clock, use #TIMESTAMP_RAW instead (see below).

#TIMESTAMP_RAW:
Return a raw clock value that is independent of the system clock and is monotonically increasing. This can be useful because #TIMESTAMP_UNIX depends on the system clock because it returns the number of seconds since January 1st, 1970 so you could be in trouble in case the system clock is changed between two GetTimestamp() calls. (V9.1)

GetTimestamp() is especially useful in connection with Hollywood's event handler. All event messages will contain a field named Timestamp which contains the timestamp the event was generated. If you compare this time stamp against the return value of GetTimestamp(), you can filter out very old events, for example. See InstallEventHandler for details.

To convert a timestamp into a date, you can use the TimestampToDate() function. To convert a date into a timestamp, use the DateToTimestamp() function.

Inputs
type
optional: the kind of timestamp to get; see above for possible types (defaults to #TIMESTAMP_START)
Results
s
timestamp in seconds as a fractional number

Show TOC