mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Device.Time.CurrentLocalTime: Fix time format
- Update timezone format from '+hhmm' or '-hhmm' to '+hh:mm' or '-hh:mm'
This commit is contained in:
parent
dd113367d4
commit
10c5029c67
1 changed files with 6 additions and 1 deletions
|
|
@ -1022,7 +1022,7 @@ int dm_time_format(time_t ts, char **dst)
|
|||
char time_buf[32] = { 0, 0 };
|
||||
struct tm *t_tm;
|
||||
|
||||
*dst = "0001-01-01T00:00:00Z";
|
||||
*dst = "0001-01-01T00:00:00+00:00";
|
||||
|
||||
t_tm = localtime(&ts);
|
||||
if (t_tm == NULL)
|
||||
|
|
@ -1031,6 +1031,11 @@ int dm_time_format(time_t ts, char **dst)
|
|||
if(strftime(time_buf, sizeof(time_buf), "%Y-%m-%dT%H:%M:%S%z", t_tm) == 0)
|
||||
return -1;
|
||||
|
||||
time_buf[25] = time_buf[24];
|
||||
time_buf[24] = time_buf[23];
|
||||
time_buf[22] = ':';
|
||||
time_buf[26] = '\0';
|
||||
|
||||
*dst = dmstrdup(time_buf);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue