Click here to Skip to main content
15,885,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The listItemToTime before making it to getTimeZoneOffset displays in UTC format,
Like this 2014-10-15T10:00:00Z
JavaScript
var toTime = new Date(listItemToTime).getTimezoneOffset();


But after using getTimeZoneOffset(); the value gets -60 and that Ok, but how do i remove -60 from the listItemToTime(2014-10-15T10:00:00Z) Because it displays it -60
Posted
Comments
DamithSL 20-Nov-14 3:27am    
what is listItemToTime?
Kurac1 20-Nov-14 3:31am    
its my variabel were the date and time are displayed
DamithSL 20-Nov-14 3:37am    
var newDate = new Date(new Date(listItemToTime) + toTime*60000);
Kurac1 20-Nov-14 4:53am    
@DamithSL

I get invalid date on newDate,

var result = listItemCustom + "T" + listItemFromTime + ":00" + "Z";


var result2 = listItemtoDate + "T" + listItemToTime + ":00" + "Z";


var toTime = new Date(result).getTimezoneOffset();
var newDate = new Date(new Date(result) + toTime * 60000);

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