c++ - Shifted timestamp in C/C from PostgreSQL DB and Linux? -
i'm using c++ , libpq (postgresql c library) gcc , postgresql 8.2.19 on linux. i'm using column of type "timestamp time zone". libpq returns query results c-strings. (not always) found string returned shifted 1 hour forward (but same timezone others: +02 cest). verified problem directly in string returned query (a normal select name of column containing "timestamp time zone" type) , not subsquent conversions , execution runs exactly. sort of (known) bug of linux and/or postgresql?
edit: 1 time error occured in following conversions tried code on platform (obviously including libraries) http://codepad.org/hibbjx0v actually, not coherent error opposite: time time shifted forward of 1 hour , in second output hour still 11:33:52 in code. tried ubuntu manual hour setting , hour internet. there error in both cases. think error @ system level don't is.
edit: i'm not sure anymore error postgresql because row timestamp updated twice in quick succession , perhaps erorr due first update hour converted linux type showed in code.
i made stupid error due scarse experience. see in code on codepad allocated struct tm* data malloc, initializing localtime(&now) time_t = time(null) times processed correctly. think without doing variable of type struct tm* "doesn't know" time zone.
Comments
Post a Comment