Ciao,

I encountered some problems with strptime function.

I don't understand why my configure script detects strptime function, but
compiler does not the same ... :-(

I include <time.h> as man pages suggest ... I overpass it by calling
Htstrptime function included in file strptime.c of htlib.

Another problem: when using strptime, struct tm value is always stored in a
localtime format. And so when I store a GM value, the coinversion comes ...

Here are some results (give a look at the Test static method):

This is for %Y.%m.%d %H:%M:%S format (without timezone):

Parsing date string 1970.01.01 00:00:00 - format %Y.%m.%d %H:%M:%S

         Local - Date Time n. 1 : Thu, 01 Jan 1970 00:00:00 CET
         GM    - Date Time n. 1 : Wed, 31 Dec 1969 23:00:00 GMT

Struct TM fields
================
tm_sec   :      0
tm_min   :      0
tm_hour  :      23
tm_mday  :      31
tm_mon   :      11
tm_year  :      69
tm_wday  :      3
tm_yday  :      364
tm_isdst :      0



...


This is for ISO8601 format. Look at how I tried to set different timezones,
but results are not as I hoped (former GMT, then CET):

Parsing date string 1970-01-01 00:00:00 GMT - format %Y-%m-%d %H:%M:%S %Z

         Local - Date Time n. 1 : Thu, 01 Jan 1970 00:00:00 CET
         GM    - Date Time n. 1 : Wed, 31 Dec 1969 23:00:00 GMT
Struct TM fields
================
tm_sec   :      0
tm_min   :      0
tm_hour  :      23
tm_mday  :      31
tm_mon   :      11
tm_year  :      69
tm_wday  :      3
tm_yday  :      364
tm_isdst :      0


Parsing date string 1970-01-01 00:00:00 CET - format %Y-%m-%d %H:%M:%S %Z

         Local - Date Time n. 2 : Thu, 01 Jan 1970 00:00:00 CET
         GM    - Date Time n. 2 : Wed, 31 Dec 1969 23:00:00 GMT
Struct TM fields
================
tm_sec   :      0
tm_min   :      0
tm_hour  :      23
tm_mday  :      31
tm_mon   :      11
tm_year  :      69
tm_wday  :      3
tm_yday  :      364
tm_isdst :      0



Well, let me know ...
Have a nice week end.

-Gabriele

HtDateTime.zip



-------------------------------------------------

Gabriele Bartolini
U.O. Rete Civica - Comune di Prato
Prato - Italia - Europa

e-mail: [EMAIL PROTECTED]
http://www.po-net.prato.it

-------------------------------------------------

Reply via email to