Added YYYY_MM_DD_HHMMSS to the decodable forms of timestamps

This commit is contained in:
Thomas Schmitt 2024-06-28 08:56:44 +02:00
parent 25743e4ec5
commit 9222d38f19
2 changed files with 6 additions and 5 deletions

View File

@ -510,7 +510,7 @@ int Decode_ecma119_format(struct tm *erg, char *text, int flag)
int Decode_xorriso_timestamp(struct tm *erg, char *code, int flag)
/* 2007.11.07.225624 */
/* 2007.11.07.225624 or 2007_11_07_225624 */
{
char buf[20];
int year,month,day,hour= 0,minute= 0,second= 0, i, l, mem;
@ -525,19 +525,20 @@ int Decode_xorriso_timestamp(struct tm *erg, char *code, int flag)
for(i= 0; buf[i]!=0 && i<4; i++)
if(!isdigit(buf[i]))
return(0);
if(buf[4]!='.')
if(buf[4] != '.' && buf[4] != '_')
return(0);
buf[4]= 0;
sscanf(buf, "%d", &year);
if(year<1900 || year>3000)
return(0);
if(!(isdigit(buf[5]) && isdigit(buf[6]) && buf[7]=='.'))
if(!(isdigit(buf[5]) && isdigit(buf[6]) && (buf[7] == '.' || buf[7] == '_')))
return(0);
buf[7]= 0;
sscanf(buf+5, "%d", &month);
if(month<1 || month>12)
return(0);
if(!(isdigit(buf[8]) && isdigit(buf[9]) && (buf[10]=='.' || buf[10]==0)))
if(!(isdigit(buf[8]) && isdigit(buf[9]) &&
(buf[10]=='.' || buf[10]=='_' || buf[10]==0)))
return(0);
buf[10]= 0;
sscanf(buf+8, "%d", &day);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.05.19.204636"
#define Xorriso_timestamP "2024.06.28.065555"