updating oE to_unix
to_unix
include datetime.e -- (default namespace is datetime) public function to_unix(datetime dt)
Converts a datetime value to the Unix numeric format (seconds since EPOCH_1970).
Parameters:
- dt : a datetime to be queried.
Returns:
An atom, so this will not overflow during the winter 2038-2039.
Example 1:
include std/datetime.e atom secs_since_epoch = to_unix(now()) -- secs_since_epoch is equal to the current seconds since epoch ? secs_since_epoch
Result:
1567910956 (your number will vary!)
See Also:
Not Categorized, Please Help
|