Convert C ++ time_t to Delphi TDateTime

In a Delphi XE application, I read values ​​from a database originally created by a C ++ program. There is a date column that is stored (will look) like time_t, i.e. Unix time, seconds since 00:00, January 1, 1970 UTC. I can deal with the time zone, but how can I get the TDateTime from (long) time_t?

+3
source share
2 answers

Try using the unixtodatetime function, which is part of the Dateutils block: http://docwiki.embarcadero.com/VCL/en/DateUtils.UnixToDateTime

+11
source

- , time_t , TDateTime 00:00, 1 1970 .

( RRUZ , ).

+3

Source: https://habr.com/ru/post/1792405/


All Articles