Date & Time

Function names shown in green are actually macros defined in userdefs.udf. See Macros.

@date
Current date in days since December 30, 1899 (this is a common database standard).

@time
Current time in fraction of a day.

@now
@Date+@time.

@hourfromtime[@time]
Extracts the hour from a @time value.

@minfromtime[@time]
Extracts the minute from a @time value.

@secfromtime[@time]
Extracts the second from a @time value.

@msfromtime[@time]
Extracts the millisecond from a @time value.

The following return a value extracted from @now, using the above -fromtime functions:
@second
@minute
@hour
@msnow (milliseconds)

@eventtime
Valid only within a behavior table entry, this returns the time that the event occurred, in the same format as @time, @now, etc.

@timestamp
Valid only within a behavior table entry, this returns the time that the event occurred, in C format (i.e., the same format as @ctime, etc.)  (As of version 2.9.4, this is a macro derived from @eventtime.)

@dateof[$d]
Converts string date (like "11/1/98") to numerical date.

@timeof[$t]
Converts string time (like "4:10 PM") to numerical time.
$date[@d]
Returns date string like "11/1/98" converted from date @d.

$time[@t]
Returns time string like "4:10 PM" converted from time @t.

@ctime
Current time+date in seconds since January 1, 1970 (this is a C standard, the same used for object creation times in propdump files, and by the SDK).

$ctime[@ct]
Returns a date+time string derived from a ctime value.

@vrt
Returns the VR time+date in ctime format.

$vrt
Returns the VR time in $ctime format.

Each of the following returns true (1) during the appropriate time of day.
@am
@pm
@morning
@afternoon
@evening
@weesmall (1am to 6am)
@dawn (6am to 7am)
@dusk (6pm to 7pm)
@twilight (dawn or dusk)
@day (7am to 6pm)
@night (7pm to 6am)

@vrtime
Returns VR time in the same format as @now, etc. Use the $time function to convert this to a string, or use the $vrtime function. that returns a string.

$vrtime
VR time in string form.

Back to Functions