On most systems (i.e. POSIX), os.date("%X",0) gives you an epoch time of 00:00:00 (coordinated universal time, UTC) on January 1, 1970. You get 20:00:00 because you are in a different time zone.
To configure UTC instead of your time zone, run the format ! . This is indicated in manual .
So use os.date("!%X",0) to get 00:00:00 as desired. It will work with any number of seconds in less than one day (86400). For example, os.date("!%X",70) gives 00:01:10 : 1 minute and 10 seconds.
lhf
source share