I am using the jQuery JQGrid plug-in, version 3.8.2 and am having trouble trying to figure out how to format a date/time for display. The date/time comes in ISO long format, i.e. 2011-02-16T14:46:43Z. I want it shown in mm/dd/yy H:m:s format. Here is my current code, which does not work:
currOption.formatoptions = {
srcformat: 'Y-m-dQH:i:sZ',
newformat: 'm/d/Y g:i A'
};
Note that I have a “Q” in there because if I use “T”, it blows up (which makes sense, as “T” has meaning in PHP date formatting).
Can anyone help me figure out how to properly do this formatting?
Turns out that you have to leave out the “T” and “Z” to make it read the incoming date/times properly. This code works:
I hope this helps others who encounter the same problem!