jquery - Create a new Date() in JavaScript with my parameter -
i have following code:
$(function () { var timestamp = 1443563590; //tue, 29 sep 2015 21:53:10 gmt var today2 = moment.unix(timestamp).tz('america/new_york').tostring(); alert(today2); //var dateinnewyork = new date(what should type here?); //alert(dateinnewyork.gethours()); });
and want create new date based on can see above. in future timestamp server, i'll keep current time in new york on client's side, whether has current time set in computer or not. how can create date then? http://jsfiddle.net/b8o5cvdz/5/
not sure understood completely, attempt answer understood:
$(function () { var timestamp = 1443563590; //tue, 29 sep 2015 21:53:10 gmt var today2 = moment.unix(timestamp).tz('america/new_york').tostring(); alert(today2); var dateinnewyork = new date(today2); alert(dateinnewyork.gethours()); });
Comments
Post a Comment