Posted By

acosonic on 07/08/10


c timestamp

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Proper c# get timestamp

 / Published in: C#

Well, there is many faulty C# timestamp handling codes.

Here is a proper one, use UtcNow instead Now if you need UTC timestamp...

  1. //Find unix timestamp (seconds since 01/01/1970)
  2. long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
  3. ticks /= 10000000; //Convert windows ticks to seconds
  4. timestamp = ticks.ToString();

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Jacky888 on October 15, 2018

tct alcatel one touch evo7hd e710 frpbypassapkpro

You need to login to post a comment.