I use a data picker like that:
$('#startTime').datepicker("option", "dateFormat", 'yy-mm-dd ');
However when I want to set it I have a epoch time value that comes from my server (milliseconds since the standard base time January 1, 1970) How can I do that when I set it like this it just shows a number instead of date as usual?
$('#startTime').datepicker("option", "dateFormat", '@');
@
sets the format to UNIX timestamp -> http://docs.jquery.com/UI/Datepicker/formatDate
Please note: This is in milliseconds, not seconds
$(function()
{
$("input[type='text']")
.datepicker({ dateFormat: '@' })
.change( function(){ this.value = parseInt(this.value,10)/1000; });
});
this is what I did to get the seconds vs. ms from the datepicker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With