[asterisk-dev] CDR and daylight savings time

Kevin P. Fleming kpfleming at digium.com
Sun Dec 31 20:07:47 MST 2006


Hans Petter Selasky wrote:
> From examining the code, this seems to be the case:
> 
>                 gettimeofday(&cdr->start, NULL);
>                 gettimeofday(&cdr->answer, NULL);
>                 gettimeofday(&cdr->end, NULL);

If you had read the man page for gettimeofday(), you would not have
asked this question :-)

gettimeofday(), when passed NULL as the second parameter (which we
always do and is recommended practice) returns the number of
seconds/microseconds since the Unix 'epoch' (January 1, 1970). It does
not care about timezones at all, and is not affected by timezones or
time shifts. In other words, it returns absolute time, not local time.


More information about the asterisk-dev mailing list