Commit c1095b0c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

scanTimeString: handle separator between reference date and time more flexible.

parent 9fa73548
...@@ -123,8 +123,9 @@ void scanTimeString(const char *ptu, int64_t *rdate, int *rtime) ...@@ -123,8 +123,9 @@ void scanTimeString(const char *ptu, int64_t *rdate, int *rtime)
int year = 1, month = 1, day = 1; int year = 1, month = 1, day = 1;
int hour = 0, minute = 0, second = 0; int hour = 0, minute = 0, second = 0;
int v1 = 1, v2 = 1, v3 = 1; int v1 = 1, v2 = 1, v3 = 1;
char ch = ' ';
if ( *ptu ) sscanf(ptu, "%d-%d-%d %d:%d:%d", &v1, &v2, &v3, &hour, &minute, &second); if ( *ptu ) sscanf(ptu, "%d-%d-%d%c%d:%d:%d", &v1, &v2, &v3, &ch, &hour, &minute, &second);
if ( v3 > 999 && v1 < 32 ) if ( v3 > 999 && v1 < 32 )
{ year = v3; month = v2; day = v1; } { year = v3; month = v2; day = v1; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment