javascript – How do I find out what date format this is? – Education Career Blog

Wed Oct 20 2010 14:11:39 GMT-0500 (CST) {}

More detail (sorry):

I’m trying to pass in a date (like above) from the fullcalendar plugin to the jQueryUI datepicker like so:

                    $('#miniCalendar').datepicker({defaultDate: date});  

where date = Wed Oct 20 2010 14:11:39 GMT-0500 (CST) {}

datepicker accepts a variety of date formats:

from the docs

There are also a number of predefined standard date formats available from $.datepicker:

* ATOM - 'yy-mm-dd' (Same as RFC 3339/ISO 8601)
* COOKIE - 'D, dd M yy'
* ISO_8601 - 'yy-mm-dd'
* RFC_822 - 'D, d M y' (See RFC 822)
* RFC_850 - 'DD, dd-M-y' (See RFC 850)
* RFC_1036 - 'D, d M y' (See RFC 1036)
* RFC_1123 - 'D, d M yy' (See RFC 1123)
* RFC_2822 - 'D, d M yy' (See RFC 2822)
* RSS - 'D, d M y' (Same as RFC 822)
* TICKS - '!'
* W3C - 'yy-mm-dd' (Same as ISO 8601)

I’m wondering if the date returned above matches any of the predefined date formats. I’m hoping to avoid writing a parse and format script but it’s not looking good. Thanks in advance.


D M j Y H:i:s eO (T) {} or D M d Y H:i:s eO (T) {}

Doesn’t look like any of the standard date formats out there. They usually have a comma after the day of week name.


Me again. That is the output of the JavaScript Date.toString method (plus a {}). Didn’t expect that one.

Leave a Comment