Use of timestamps in otp

Joachim Durchholz joachim.durchholz@REDACTED
Sat Jul 26 10:44:49 CEST 2003


Per Bergqvist wrote:
> No problem with that but nn interesting observation is that there is 
> no unambiguous tranformation of local_time -> universal_time. For 
> universal_time -> local_time there is.

Do you mean stuff like "03:30 on the day when switching from summer
time to winter time", when there is an extra hour between 03:00 and 
04:00? This is nasty but manageable: the first hour is 03:00 to 04:00 
EST, the second our 03:00 to 04:00 MET. (I hope that local time includes 
time zone information...)

Are there other sources of ambiguity?

> I think that all parts of the system (i.e. sasl logging and snmp) 
> should always generate time stamps in universal time and then convert
> to local time if requested by the user. Today the behaviour is the
> the opposite (timestamps are generated as local time) and it is not
> correct.

I'd agree with that.
There are two reasons, both relevant only when data is gathered in
different time zones:
1) Time zone information tends to be misconfigured. Under Unixoid
systems, end users are able to set (and hence misconfigure) their TZ
variable. UTC information is usually more reliable.
2) Comparing or subtracting timestamps gathered in different time zones
is a bit complicated and easy to do wrong. UTC timestamps can be
manipulated directly, with little room for dumb errors.

Hope my 5 cent are of use,
Jo




More information about the erlang-questions mailing list