Solved

jQuery UI datepicker unix timestamp giving extra zeros

Posted on 2014-04-18
2
1,034 Views
Last Modified: 2014-05-02
Hi,

I'm just wondering why jQuery's UI datepicker returns extra zeros (3 to be exact) at the end of their unix timestamp:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>jQuery UI Datepicker - Dates in other months</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">
    <script>
        $(function() {
            $( "#datepicker" ).datepicker({
                showOtherMonths: true,
                selectOtherMonths: false,
                altField: "#alternate",
                altFormat: "@"
            });
        });
    </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>
<p>Date: <input type="text" id="alternate"></p>


</body>
</html>

Open in new window


http://api.jqueryui.com/datepicker/#utility-formatDate

Is there something I'm missing?

thank you and God bless<><
Victor
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 total points
ID: 40010715
JS getTime is in milliseconds. Unix timestamp is in seconds
0
 
LVL 25

Assisted Solution

by:lenamtl
lenamtl earned 250 total points
ID: 40018024
Try dateFormat instead of altFormat

replace
altFormat: "@"
by
dateFormat: "@"

or
dateFormat: '@'
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question