network_time()

Am I correct in thinking that the network_time() BiF gives the time in the local timezone? If that's true, do we have a way to get the current UTC time?

  .Seth

No. It gives seconds since epoch which is independent from the timezone (epoch is midnight 1/1/70 UTC)

cu
Gregor

I know that epoch is like that, but network_time() give a time-typed value, not epoch time (as a count). When I print the value with %T in a call to fmt it's coming out in local time.

  .Seth

Hmm. Interesting. I've actually never used %T to format at timestamp. I always used %f (or %d) which just prints the time in seconds since epoch. So I guess the problem is that %T always formats the time in local time.

Looks like there is a strftime() BiF, but it also uses localtime(). We might want to modify strftime() so one can pass an arbitrary timezone.

As for %T (and %D for that matter): Maybe either discourage it and always use strftime() instead or add a global that defines the timezone for %T/%D....

cu
Gregor