2023-11-11 13:33 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/common/hbdate.c
    * accept timestamp values with trailing "Z" indicating UTC time
      (zero hour offset)
This commit is contained in:
Przemysław Czerpak
2023-11-11 13:33:23 +01:00
parent deda6c73fa
commit d12558f0ca
2 changed files with 29 additions and 19 deletions

View File

@@ -7,6 +7,11 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */
2023-11-11 13:33 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/common/hbdate.c
* accept timestamp values with trailing "Z" indicating UTC time
(zero hour offset)
2023-11-09 15:07 UTC+0100 Phil Krylov (phil a t krylov.eu)
* .github/workflows/linux-ci.yml
* .github/workflows/macos-ci.yml

View File

@@ -545,27 +545,32 @@ HB_BOOL hb_timeStrGet( const char * szTime,
}
}
}
while( HB_ISSPACE( *szTime ) )
if( iBlocks > 0 && ( szTime[ 0 ] == 'Z' || szTime[ 0 ] == 'z' ) )
++szTime;
if( ( szTime[ 0 ] == 'p' || szTime[ 0 ] == 'P' ) &&
( szTime[ 1 ] == 'm' || szTime[ 1 ] == 'M' ) )
else
{
++iBlocks;
szTime += 2;
if( iHour == 0 )
iHour = 24; /* wrong time */
else if( iHour != 12 )
iHour += 12;
}
else if( ( szTime[ 0 ] == 'a' || szTime[ 0 ] == 'A' ) &&
( szTime[ 1 ] == 'm' || szTime[ 1 ] == 'M' ) )
{
++iBlocks;
szTime += 2;
if( iHour == 0 )
iHour = 24; /* wrong time */
else if( iHour == 12 )
iHour = 0;
while( HB_ISSPACE( *szTime ) )
++szTime;
if( ( szTime[ 0 ] == 'p' || szTime[ 0 ] == 'P' ) &&
( szTime[ 1 ] == 'm' || szTime[ 1 ] == 'M' ) )
{
++iBlocks;
szTime += 2;
if( iHour == 0 )
iHour = 24; /* wrong time */
else if( iHour != 12 )
iHour += 12;
}
else if( ( szTime[ 0 ] == 'a' || szTime[ 0 ] == 'A' ) &&
( szTime[ 1 ] == 'm' || szTime[ 1 ] == 'M' ) )
{
++iBlocks;
szTime += 2;
if( iHour == 0 )
iHour = 24; /* wrong time */
else if( iHour == 12 )
iHour = 0;
}
}
while( HB_ISSPACE( *szTime ) )
++szTime;