newlib: how to set local timezone for localtime()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

newlib: how to set local timezone for localtime()

815 Views
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.

Tags (2)
0 Kudos
0 Replies