jQuery UI Widgets Forums Editors DateTimeInput Converting Date value to timestamp

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 12 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Converting Date value to timestamp #6320

    mc
    Member

    Hello,
    How can i convert getdate value to timestamp,

    var getDate= $('#jqxWidget1').jqxDateTimeInput('getDate');

    and what is the structure of getdate variable? Could you add structure of variables what methodes returms.

    Also i couldnt see explanatıon of ‘F’ and ‘T’ values for ”formatString” in documentation of jqxDateTimeInput API.

    Converting Date value to timestamp #6347

    Dimitar
    Participant

    Hi mc,

    1) To convert your getDate value to timestamp use the getTime() function. For example:

    var timestamp = getDate.getTime();

    This will return a timestamp showing the number of milliseconds since 01.01.1970.

    2) Here is the explanation of these formats:

    “F” (long date, long time pattern) – “dddd, MMMM dd, yyyy h:mm:ss tt”

    “T” (long time pattern) – “h:mm:ss tt”

    Used Date format strings:

    “dd”-the day of the month;
    “dddd”- the full name of the day of the week;
    “h”-the hour, using a 12-hour clock from 1 to 12;
    “mm”-the minutes,from 00 though59;
    “MMMM”-the full name of the month;
    “ss”-the second, from 00 through 59;
    “tt”-the AM/PM designator;
    “yyyy”-the year as a four-digit number;

    Best Regards,
    Dimitar,

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.