time(0) is for UTC or local time?

Nov 8, 2017 at 11:52am
Hi,

I am using time(0) for current timestamp for communication in Debian Jessie platform, but it seems different VMs or embedded systems (all running Debian Jessie) have different result, some for UTC and some for localtime. How can I make time(0) consistent for UTC only?

Thank you.

Kind regards.
Nov 8, 2017 at 11:01pm
Are you sure the system clocks are correct? It should give you the number of seconds since 1970-01-01 00:00:00 (UTC).
Nov 9, 2017 at 3:07am
closed account (E0p9LyTq)
How can I make time(0) consistent for UTC only?

Take the output from time() and use it as an input to gtime().


http://en.cppreference.com/w/c/chrono/gmtime
Topic archived. No new replies allowed.