On Fri, Aug 3, 2012 at 7:18 AM, Stanislav Frolov <frolosofsky@gmail.com> wrote:
Looks like localtime returns 3 hours instead of 4.
And datetimes for current time_t:
[...]Difference between gmtime and localtime is 4 hours. Bug? Feature?

Obviously a bug in the C library or a misconfiguration from your system. Following the ISO and POSIX standards
http://pubs.opengroup.org/onlinepubs/009695299/functions/localtime.html

"The localtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as a local time. The function corrects for the timezone and any seasonal time adjustments. [CX]   Local timezone information is used as though localtime() calls tzset()."

Juanjo

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain) 
http://juanjose.garciaripoll.googlepages.com