Novas funções UTC atualização 23-01-2025

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Novas funções UTC atualização 23-01-2025

Mensagem por Itamar M. Lins Jr. »

Olá!
2025-01-23 17:45 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdate.h
* src/common/hbdate.c
* src/harbour.def
+ added new C functions:
HB_BOOL hb_timeStrGetUTC( const char * szTime,
int * piHour, int * piMinutes,
int * piSeconds, int * piMSec,
int * piUTCOffset );
HB_BOOL hb_timeStampStrGetUTC( const char * szDateTime,
int * piYear, int * piMonth,
int * piDay, int * piHour,
int * piMinutes, int * piSeconds,
int * piMSec, int * piUTCOffset );
They can decode timestamp value with ISO 8601 UTC offset.

* src/common/hbdate.c
* use hb_timeStampStrGetUTC() in hb_timeStampStrGetDT() and return UTC
time if it was with UTC offset
Now Harbour compiler accept timestamp strings with with UTC offset, i.e.
? t"2025-01-22 00:45 UTC+0100" // => 2025-01-21 23:45:00.000
Also HB_StrToTS() supports it.

* src/pp/hbpp.c
* use new hb_timeStampStrGetDT() to decode timestamp from ChangeLog to
build revision number. It also fixes bug with decoding negative UTC
offsets.

best regards
Przemek
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Responder