javascript - jquery datepicker value to UTC timestamp -
i using jquery datetime picker , when user selects value need user selection converted utc timestamp pass php webservice using ajax.
datepicker using shows value in 2014/09/01 11:57 format. please let me know how can convert utc timestamp in javascript.
before jquery datetime picker used have html5 datetime input elements , reading there values using jquery , converting them utc timestamp , wrote custom functions. client asked use jquery datetime picker , utc thing.
date.parse("2014/09/01 11:57");
or
new date("2014/09/01 11:57");
this create date object. can return utc timestamp date object's gettime() or valueof() functions.
there's lot of excellent javascript documentation @ mozilla developer network. docs date object here:
https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/date
Comments
Post a Comment