Re: Please help me in sorting my problem with time_t
"siva" <sivaammula@gmail.com> ha scritto nel messaggio
news:c2c3df5c-9df7-4567-82a8-e0cb693cd1f8@e25g2000prg.googlegroups.com...
I had a field of type time_t which is used for storing the time.
While working in QNX my system reads the value and displays time as
23:59:55 Dec 17,2007 while if i am reading the same file from windows
with the same structure and displays the time i am getting 19:59:55
Dec16,1997.
What could be the problem can any one help me in this regard.
You may try to read the following MSDN article:
"How To Convert a UNIX time_t to a Win32 FILETIME or SYSTEMTIME"
http://support.microsoft.com/?scid=kb%3Ben-us%3B167296&x=12&y=7
or you may want to save your date/time using a different custom format, e.g.
define a custom structure and store separately the
day-month-year-hours-minute-seconds fields, like:
struct my_time {
int day;
int month;
int year;
int hour;
...
};
so you can write and read this custom data-time fileds (just integers) as
you do for other fields in your binary file.
Giovanni