newlib: how to set local timezone for localtime()

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

newlib: how to set local timezone for localtime()

1,396 次查看
giusloq
Contributor III

I have an UTC time (seconds since epoch) received from a NTP server. I need to convert it to broken-down local time.

I know I can use localtime(), but it returns the UTC broken-down time. I think because no timezone is configured.

I'm using MCUXpresso IDE and newlib-nano libraries.

Now the question: I can configure the timezone that must be used during localtime() conversion? In my case, it is Italy timezone. Of course, the daylight should be taken into account.

标记 (2)
0 项奖励
回复
0 回复数