The timestamp of C # is used in flash actionscript.

Source: Internet
Author: User

The timestamp of C # is used in flash actionscript.

Currently, we are working on a project to transmit timestamps to flash in bytes,

If the error is returned, the following code can be used:

C #

DateTime centuryBegin = new DateTime (1970, 1,); DateTime currentDate = new DateTime (DateTime. now. year, DateTime. now. month, DateTime. now. day, DateTime. now. hour, DateTime. now. minute, DateTime. now. second); long elapsedTicks = currentDate. ticks-centuryBegin. ticks;

14071475100000000 output

Flash actionscript

Var d: Date = new Date (0); trace (d); d. setMilliseconds (1407147510000); // 14071475100000000 is passed over to 10 ^ 9 in nanoseconds, and here is millisecond trace (d );


Output
Mon Aug 4 18:18:30 GMT + 0800 2014

Note that in C #, the nanoseconds are 10 ^ 4 times more.

While as is 1407147510000 in milliseconds

Related Article

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.