[ntp:questions] Converting from Y-m-d h:m:s

Rob nomail at example.com
Sat May 15 16:58:13 UTC 2010

Terje Mathisen <"terje.mathisen at tmsw.no"> wrote:
> Going from YMDHMS to unix (or ntp) seconds is really quite trivial, 
> while the opposite direction is much harder!
> My most efficient algorithm for the reverse function needs somewhere 
> between 30 and 50 clock cycles (compare with 40 cycles for a single DIV 
> opcode...), while the forward function is about twice as fast:

Have you seen how glibc approaches this conversion?

More information about the questions mailing list