time_extract/3—retrieve fields from a time stamp
The time_extract/3 function retrieves fields from a time stamp. The syntax for this function is as follows:
$VALS=time_extract($TIME,$FLDS)
time_extract/3 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$TIME | Input | INTEGER | Specifies the time stamp from which a field or list of fields are to be retrieved |
$FLDS | Input |
| Specifies the field or list of fields to be retrieved |
$VALS | Output |
| Retrieved field value or list of retrieved field values |
Use the time_extract/3 function to retrieve one or more fields as specified in $FLDS from the time stamp $TIME into the $VALS argument.
The time stamp is a time value in internal numeric form, similar to the date_reception slot, or as retrieved from the time_stamp/1 primitive. The fields retrieved from the time stamp reflect the local actual time zone of the system on which the cell is running.
Time stamp fields are indicated by name. Available fields are:
date | Date part as an integer of the form YYYYMMDD |
time | Time part as an integer of the form HHMMSS |
year | Year (including century) |
month | Month (1..12) |
day | Day of month (1..31) |
wday | Day of week (0..6, 0=Sunday) |
yday | Day of year (1..366) |
hour | Hour (0..23) |
min | Minutes (0..59) |
sec | Seconds (0..61) (value >59 in case of leap seconds) |
All returned field values are integer numbers. Note that the values for the date and time fields are also integers, structured in a fixed decimal format. A time value will not always have six significant digits. Times before 10:00:00 only have five significant decimal digits.
The $VALS argument can be specified as one variable that will get the single requested field value or a list containing all requested field values. $VALS can also be specified as a list of as many variables as the number of requested fields.
time_extract/3 example
Variables $DT and $TM will contain the date and time of the time stamp, as integers, for the time the event was received. For instance, if the event was received on 6-Feb-2007 at 9:15:20, $DT would be 20070206 and $TM would be 91520.