User Profile

Collapse

Profile Sidebar

Collapse
MCBoy
MCBoy
Last Activity: Aug 27 '10, 06:25 PM
Joined: Feb 21 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • it is UTC guys

    by default javascript date object is UTC. All dates are calculated in milliseconds from 01 January, 1970 00:00:00 Universal Time (UTC) with a day containing 86,400,000 milliseconds.

    refer: http://www.w3schools.c om/js/js_obj_date.asp (W3Schools, JavaScript Date Object).
    See more | Go to post

    Leave a comment:


  • the corrected one!

    UTC should be taken into consideration!!

    Code:
    private Int64 GetTime()
    {
       Int64 retval=0;
       DateTime st=DateTime(1970,1,1);
       TimeSpan t= (DateTime.Now.ToUniversalTime()-st);
       retval= (Int64)(t.TotalMilliseconds+0.5)
       return retval;
    }
    See more | Go to post

    Leave a comment:


  • MCBoy
    replied to getTime() method in C#
    in .NET
    The corrected one!

    if you are using a system, where the current time is not in UTC, then this will not work. javascript getTime gets the diff with UTC.

    # private Int64 GetTime()
    # {
    # Int64 retval=0;
    # DateTime st=DateTime(197 0,1,1);
    # TimeSpan t= (DateTime.Now.T oUniversalTime( )-st);
    # retval= (Int64)(t.Total Milliseconds+0. 5)
    # return retval;
    # }
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...