tags:

views:

39

answers:

1

A unix timestamp should only be ten characters, however I keep getting 13 characters and it's causing me issues. How can I fix this?

<script type="text/javascript">
$(document).ready(function()
{
    $("#startdate").datepicker({ altField: "#startdatehidden", altFormat:$.datepicker.TIMESTAMP, dateFormat:$.datepicker.TIMESTAMP, mandatory: true });
});
</script>
A: 

Do you mean that you're getting something like 1280943953000 instead of 1280943953?

If yes, that's because javascript counts time in milliseconds, so you should try to
divide the timestamp by 1000
or
substring the last three digits

aletzo
I was trying to divide by 1000 from within jquery.ui.datepicker.js, but I'm not sure where to do it. Both places I tried caused the timestamp to show negative numbers.
dallen
hmmm... do you have the lastest version of the plugin? It seems that this issue has been corrected in version 4.0.0
aletzo