SNTP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
670件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
398件の閲覧回数
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 件の賞賛
1 返信
399件の閲覧回数
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 件の賞賛