C # Unix timestamp conversion,

Source: Internet
Author: User

C # Unix timestamp conversion,

If you encounter Unix timestamp conversion problems, record them.

Convert Unix timestamp to DateTime

String UnixTime = "1474449764"; // timestamp System. dateTime startTime = TimeZone. currentTimeZone. toLocalTime (new System. dateTime (1970, 1, 1); DateTime TranslateDate = startTime. addSeconds (double. parse (UnixTime ));

DateTime to Unix Timestamp

// DateTime to Unix timestamp DateTime DateNow = DateTime. Now; long UnixDate = (DateTime. Now. ToUniversalTime (). Ticks-621355968000000000)/10000000;

Note: This is a time stamp conversion URL, which also supports conversion in different languages.

Http://unixtime.51240.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.