date_time::microsec_clock questions

Hello, 2 questions regarding the microsec_clock: - Why it just have 'local_time()' but not 'universal_time()' member? (Analogous to the second_clock. I know that it can be converted to UTC, but its inefficient and I have to know in which time zone the program runs.) - For what reason "::std::time(&t)" in "microsec_time_clock.hpp:58" is called? gettimeofday()'s "tv->tv_sec" already has the sec's since 1.1.1970, so there is no need for this extra call. Is it a bug? Thank you in advance! -- Donato Petrino Petrino EDV-Beratung Darmstädter Str. 29 64331 Weiterstadt T +49 6150 5418-11 F +49 6150 5418-18 email: dpetrino@petrino-edv.de

On Thu, 20 Jan 2005 03:22:01 -0500, Donato Petrino wrote
Hello,
2 questions regarding the microsec_clock:
- Why it just have 'local_time()' but not 'universal_time()' member?
Hmm, unsure what happened there -- I have a feeling that I was thrown off by gettimeofday not supporting adjustment on some platforms, but it doesn't matter why ultimately. It's easy to add this....
(Analogous to the second_clock. I know that it can be converted to UTC, but its inefficient and I have to know in which time zone the program runs.)
Yes, you are right, the client should need to do this. I've checked in an extension and test to the micro second clock for POSIX platforms that adds the universal_time call. We should have changes for windows in a few days at the most. Note that in the next release you will also be able to pass a time_zone specifier and return a locally adjusted time. This is the case where you want to get the current time in New York (just to pick one) even if the computer time isn't set for that timezone.
- For what reason "::std::time(&t)" in "microsec_time_clock.hpp:58" is called? gettimeofday()'s "tv->tv_sec" already has the sec's since 1.1.1970, so there is no need for this extra call. Is it a bug?
You are indeed correct that there was an extra call there -- it's removed now. Thanks! Jeff
participants (2)
-
Donato Petrino
-
Jeff Garland