469,643 Members | 2,064 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

time_t to C# DateTime class

How can I convert date-time data in time_t to C# DateTime class format?
e.g. I read in a file a time_t value of 1070390676. How can I convert it to
a DateTime?

Any help appreciated.

Thx,

Claire
Jul 21 '05 #1
1 17829
int t= 1070390676; // value of time_t
System.DateTime dt= new System.DateTime(1970,1,1).AddSeconds(t);
"Claire" <cl****@i3dvr.com> wrote in message
news:eO**************@TK2MSFTNGP09.phx.gbl...
How can I convert date-time data in time_t to C# DateTime class format?
e.g. I read in a file a time_t value of 1070390676. How can I convert it to a DateTime?

Any help appreciated.

Thx,

Claire

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by John J. Hughes II | last post: by
reply views Thread by Zwyatt | last post: by
reply views Thread by Zwyatt | last post: by
2 posts views Thread by Mark | last post: by
1 post views Thread by Claire | last post: by
45 posts views Thread by loudking | last post: by
4 posts views Thread by PeteOlcott | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.