Convert from UTC long value to DateTime value

  • Thread starter Stefano Del Furia
  • Start date
S

Stefano Del Furia

Hi,
i have an UTC value like
1131030339.010

Is there a way of converting it to a DateTime values ?
Thanks in advance
Stefano
 
S

Stefano Del Furia

Milliseconds.
But probably i haven't explained mh problem very well.
UTC is not the "Universal Coordinated Time" but the "UNIX Epoch" time.
Thanks in advance
stefano
 
J

Jon Skeet [C# MVP]

Stefano Del Furia said:
Milliseconds.
But probably i haven't explained mh problem very well.
UTC is not the "Universal Coordinated Time" but the "UNIX Epoch" time.

So you have a number of milliseconds after a specific time? I'd create
a "constant" (public readonly static) DateTime which represents the
Unix Epoch (if there isn't one already) and then just call
AddMilliseconds() with the number of milliseconds. The returned
DateTime is the one you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top