moni,
You could do the conversion manually. You could do this to get the base
time:
DateTime base = new Date(1970, 1, 1);
And then convert the time from time_t to this:
// The date time in time_t format.
int time_t = ...;
// The time span.
TimeSpan span = TimeSpan.FromSeconds(time_t);
// The date time.
DateTime dateTime = base + span;
Note, you could call the AddSeconds method here on the base instance and
get a new DateTime as well.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"moni" <mo*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,
I wanted to convert a time value in the form of time_t into a readable
form in C# or vice versa, in order to be able to subtract two time
values and give the result in msecs.
eg.
I have a time value,
1013120149
which is Time in seconds since UTC 1/1/70 in theory.
I need to convert this into,
11:06:31 this form.
or vice vera , i.e from the readable form into the Time in seconds
since UTC 1/1/70.
ANy help would be gr8.
Thanks.