Skip to content
Snippets Groups Projects
Commit a91b8272 authored by rswindell's avatar rswindell
Browse files

parseDateTime() now supports ISO-8601 standard date/time format:

"CCYYMMDDTHHMMSS".
parent b5d8055d
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@
#if !defined(NO_SOCKET_SUPPORT)
#include "sockwrap.h" /* inet_addr */
#endif
#include "datewrap.h" /* isoDateTime_t */
#include "dirwrap.h" /* fexist */
#include "filewrap.h" /* chsize */
#include "ini_file.h"
......@@ -1203,6 +1204,7 @@ static time_t parseDateTime(const char* value)
time_t t;
struct tm tm;
struct tm curr_tm;
isoDateTime_t iso;
ZERO_VAR(tm);
tstr[0]=0;
......@@ -1214,6 +1216,11 @@ static time_t parseDateTime(const char* value)
tm.tm_year=curr_tm.tm_year;
}
/* CCYYMMDDTHHMMSS <--- ISO-8601 date and time format */
if(sscanf(value,"%uT%u"
,&iso.date,&iso.time)>=2)
return(isoDateTime_to_time(iso));
/* DD.MM.[CC]YY [time] [p] <-- Euro/Canadian numeric date format */
if(sscanf(value,"%u.%u.%u %s %c"
,&tm.tm_mday,&tm.tm_mon,&tm.tm_year,tstr,&pm)>=2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment