mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-17 09:41:19 +01:00
Update the time format according to the standard
This commit is contained in:
parent
17e255c450
commit
bf8737c49e
1 changed files with 2 additions and 7 deletions
|
|
@ -1541,14 +1541,9 @@ int get_shift_time_time(int shift_time, char *local_time, int size)
|
|||
if (t_tm == NULL)
|
||||
return -1;
|
||||
|
||||
if (strftime(local_time, size, "%FT%T%z", t_tm) == 0)
|
||||
if (strftime(local_time, size, "%Y-%m-%dT%H:%M:%SZ", t_tm) == 0)
|
||||
return -1;
|
||||
|
||||
local_time[25] = local_time[24];
|
||||
local_time[24] = local_time[23];
|
||||
local_time[22] = ':';
|
||||
local_time[26] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1556,7 +1551,7 @@ int get_shift_time_shift(char *local_time, char *shift)
|
|||
{
|
||||
struct tm tm = {0};
|
||||
|
||||
strptime(local_time,"%FT%T", &tm);
|
||||
strptime(local_time,"%Y-%m-%dT%H:%M:%SZ", &tm);
|
||||
sprintf(shift, "%u", (unsigned int)(mktime(&tm) - time(NULL)));
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue