Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my code is

JavaScript
 var convertLocalTimeToUTC = function() {
var date = new Date();
          var utc = date.getTime();
          var offset = (date.getTimezoneOffset() /60);
          var newdate = new Date(utc + (3600000 * offset));
          var finaldate = newdate.toLocaleString();
          alert(finaldate);
}


this function does not return correct time how to solve this issue

please some one help me ...
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900