Geekpedia Programming Tutorials









Get Unix Time using C#

While interfacing with Unix applications, your C# application might need to use Unix time instead of the standard date/time format. Since the Unix time format is basically a count of the seconds passed since 1/1/1970, this can be easily done using the DateTime object.

On Wednesday, March 19th 2008 at 10:18 PM
By Andrei Pociu (View Profile)
-----   (Rated 0 with 0 votes)
Contextual Ads
More C# Resources
Advertisement
  1. int unixTime = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this code snippet
Comment Current Comments
There are no comments.

Comment Comment on this tutorial
Name: Email:
Message:
Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs C# Job Search
My skills include:
Enter a City:

Select a State:


Advanced Search >>
Latest Tech Bargains

Advertisement

Free Magazine Subscriptions

Today's Pictures

Today's Video

Other Resources

Latest Downloads

Latest Icons