View Single Post
  #30 (permalink)  
Old 06-01-2007, 09:27 AM
schemers schemers is offline
Zimbra Employee
 
Posts: 228
Default

Not familiar with VB.net, but in Java it is defined as:

Quote:
the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
I did a quick search for "utc 1970 vb.net" and found a number of hits. It sounds like .ticks in .NET is defined as:

Quote:
In .NET, DateTime.Ticks is the 100-nanosecond intervals that have
elapsed since 12:00 A.M., January 1, 0001
So one suggestion was to construct a date object for January 1, 1970, then subtract it from now. This is a C# snippet:

Al Pascual : Code Snip Collection "c# datetime utc date to javascript millisecond representation "

Code:
public double MilliTimeStamp(DateTime TheDate)
        {
            DateTime d1 = new DateTime(1970, 1, 1);
            DateTime d2 = TheDate.ToUniversalTime();
            TimeSpan ts = new TimeSpan(d2.Ticks - d1.Ticks);

            return ts.TotalMilliseconds;
        }
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote