SNTP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
856 Views
Microfelix
Contributor IV

hi

 

SNTP. I have some doubts about using the NTP server.


The server returns me the UTC date. Then how do the various time zones in different countries?

 

Maurizio

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
584 Views
Tim562
Senior Contributor I

I do this by allowing the user to specify the timezone that my product will be running in. For example if the user specifies PST (Pacific Standard Time) then I need to subtract 8 hours from UTC to derive the local time. This can prove to be slightly tricky as you have to handle the rollover of day/month/year boundries yourself (subtracting 8 hours from the UTC time might put you into the previous day, month, year) but nothing too awful.

 

~Tim

View solution in original post

0 Kudos
Reply
1 Reply
585 Views
Tim562
Senior Contributor I

I do this by allowing the user to specify the timezone that my product will be running in. For example if the user specifies PST (Pacific Standard Time) then I need to subtract 8 hours from UTC to derive the local time. This can prove to be slightly tricky as you have to handle the rollover of day/month/year boundries yourself (subtracting 8 hours from the UTC time might put you into the previous day, month, year) but nothing too awful.

 

~Tim

0 Kudos
Reply