Get Unix time (epoch)
time:format_unix("2000-1-1 10:30 UTC") #=> 946722600 # the $time argument is option and is by default time:now() time:format_unix() #=> 1578344470 # note: since Unix Epoch time is the number of seconds since 1970, this function cane return negative numbers if date is before then. # note: Unix Epoch does not depend on any specific timezone given in $time string because the distance of any timezone's "now" and its own "1970-1-1" is always the same as any other timezone's now and its relative 1970-1-1. time:format_unix("2000-1-1 10:30 PST") #=> 946751400
Copyright ©2013-2022 SunSed®. All rights reserved.