2012-05-23 11:25:51
I need a regular expression to match XML dateTime data type, preferably in javascript. The dateTime is in the following format:
YYYY-MM-DDThh:mm:ss
Or:
YYYY-MM-DDThh:mm:ssZ
Thanks for any answers.
;3418;2012-05-23 11:25:51__s__I need a regular expression to match XML dateTime data type, preferably in javascript. The dateTime is in the following format:
YYYY-MM-DDThh:mm:ss
Or:
YYYY-MM-DDThh:mm:ssZ
Thanks for any answers.
__s__~u=Jim~site=NULL__s__ Regular expression to match XML DateTime data type__s____m__2012-05-30 17:32:48__s__This function will check if a string is a valid XML DateTime:
__code__
function isDatetime(str)
{
var re = new RegExp("^([0-9]{4})-([0-1][0-9])-([0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](Z)?)$");
if(str.match(re))
return true; /* a valid xml dateTime string */
else
return false;
};
__code__
Hope this will help.
Cheers.
__s__~u=Zac~site=NULL__s__ __s____m__2013-01-14 01:48:52__s__
__s__~u=ykyk~site=NULL__s__ __s____m__
17,CSS;15,javascript;16,javascript CSS;8,XML C/C++;10,XML converter;12,XML data warehouse;13,XML database;4,XML editor;1,XML general;11,XML HTML;7,XML java;6,XML javascript;5,XML parser;9,XML PHP;2,XML schema;3,XML syntax;14,XPath;