Macworld Forums

Macworld Forums: Adding NTP servers to Date and Time's dropdown list? - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adding NTP servers to Date and Time's dropdown list? Time Servers

#1 User is offline   nonjunk 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 31-December 12

Posted 31 December 2012 - 09:43 AM

In Mountain Lion's Date and Time preference pane when setting the time automatically via NTP, there are only the 3 Apple time servers listed in the dropdown selection. While I know how to change servers manually, and while I know we're talking miliseconds difference between servers in actual usage, I'd like to add some more local-to-me servers to the dropdown box. I suspect I'd do this thru a terminal command, but not sure what to input. What would be the best way to do this?

Thanks!

0

#2 User is offline   bastion 

  • Power User
  • PipPipPipPip
  • Group: Members
  • Posts: 9,272
  • Joined: 14-October 04

Posted 31 December 2012 - 12:39 PM

View Postnonjunk, on 31 December 2012 - 09:43 AM, said:

In Mountain Lion's Date and Time preference pane when setting the time automatically via NTP, there are only the 3 Apple time servers listed in the dropdown selection. While I know how to change servers manually, and while I know we're talking miliseconds difference between servers in actual usage, I'd like to add some more local-to-me servers to the dropdown box. I suspect I'd do this thru a terminal command, but not sure what to input. What would be the best way to do this?


As a practical matter? The best way to address the issue is to do nothing, because NTP takes care of latency. Even if it didn't, a more local server wouldn't necessarily help because latency derives from factors in addition to geographical distance.

That being the case, are you still interested in this as an academic exercise?
0

#3 User is offline   nonjunk 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 31-December 12

Posted 31 December 2012 - 01:29 PM

Latency isn't the issue here. And yes, I do have need to change NTP time servers on occasion. So yes, I still would like to know how to add servers to the dropdown list--this WAS something that older Mac OSes would let you do--I would prefer to put my choices in the list and use it rather than always having to cut/paste different servers into the access box. So--the original question remains--how to add NTP servers to the dropdown lst?
0

#4 User is offline   bastion 

  • Power User
  • PipPipPipPip
  • Group: Members
  • Posts: 9,272
  • Joined: 14-October 04

Posted 02 January 2013 - 12:17 PM

View Postnonjunk, on 31 December 2012 - 01:29 PM, said:

Latency isn't the issue here. And yes, I do have need to change NTP time servers on occasion. So yes, I still would like to know how to add servers to the dropdown list--this WAS something that older Mac OSes would let you do--I would prefer to put my choices in the list and use it rather than always having to cut/paste different servers into the access box. So--the original question remains--how to add NTP servers to the dropdown lst?


I'll confess to being curious about the interest in more local servers if latency isn't the concern but you noted that the time impact is minor.

I took a dig through the Date & Time preference pane. Not only did I find no supported way to do what you ask, but based on a skim through the binary and the resource files and don't think there's an unsupported way either, short of just using another tool for your NTP configuration entirely. I may write one this weekend. I envision a traditional "dueling list" UI; left side is servers not in use, sorted alphabetically, right side is servers in use sorted by priority. You can move servers between lists by dragging or using activate/deactivate buttons, prioritize by dragging up and down in the active list or using up/down arrows, and add or delete entries at need, with the option to make them immediately active on add.

Thoughts?
0

#5 User is offline   nonjunk 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 31-December 12

Posted 02 January 2013 - 03:18 PM

That "dueling list" idea might be a good way to do it--and a way of course, to add to it. :)


A friend did a little digging and did come up with a place in the contents where you can find strings for the asia and europe time servers:

FilePath: /System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/DateTime.prefPane/Contents/Resources/English.lproj/TimePref.nib

I opened the .nib file with Textwrangler, and got to the strings with both "asia" and "europe" in the .nib file. For a test, I copied the original nib to the desktop, and then added two strings for the NTP servers I wanted. Restarted the Mac, went to the panels and tried launching Date/time and it told me that the version wouldn't work on an Intel machine. Copied the old .nib back in, and it worked as it did before. I verifed that TextWrangler kept the file type the same too. Don't know what's happening here, since all I did was add the 2 strings. If you feel like doing some detective work, the two strings I'd like to add for now are:

<string> Univ. of IL (ntp-1.cso.uiuc.edu)</string>
<string> NIST Chicago (nist1-chi.ustiming.org)</string>


Again, thanks. My programming skills on a Mac are extremely limited-- I've been using NTP servers back when all we had was dialup. I even helped with a SNTP program for the Apple II and IIGS. :)

0

#6 User is offline   bastion 

  • Power User
  • PipPipPipPip
  • Group: Members
  • Posts: 9,272
  • Joined: 14-October 04

Posted 03 January 2013 - 03:28 AM

View Postnonjunk, on 02 January 2013 - 03:18 PM, said:

That "dueling list" idea might be a good way to do it--and a way of course, to add to it. :)

A friend did a little digging and did come up with a place in the contents where you can find strings for the asia and europe time servers:

FilePath: /System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/DateTime.prefPane/Contents/Resources/English.lproj/TimePref.nib

I opened the .nib file with Textwrangler, and got to the strings with both "asia" and "europe" in the .nib file. For a test, I copied the original nib to the desktop, and then added two strings for the NTP servers I wanted. Restarted the Mac, went to the panels and tried launching Date/time and it told me that the version wouldn't work on an Intel machine. Copied the old .nib back in, and it worked as it did before. I verifed that TextWrangler kept the file type the same too. Don't know what's happening here, since all I did was add the 2 strings. If you feel like doing some detective work, the two strings I'd like to add for now are:

<string> Univ. of IL (ntp-1.cso.uiuc.edu)</string>
<string> NIST Chicago (nist1-chi.ustiming.org)</string>


Again, thanks. My programming skills on a Mac are extremely limited-- I've been using NTP servers back when all we had was dialup. I even helped with a SNTP program for the Apple II and IIGS. :)


What I found most discouraging, and frankly somewhat bizarre, in going through the prefpane was that the binary contains explicit functions to return the addresses of each of the 3 default servers. The strings in the nib appear to be used for nothing more than display. I wouldn't suggest that Apple software is perfect, but that's oddly lazy and brittle. Intern or outsourced, perhaps.
0

#7 User is offline   nonjunk 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 31-December 12

Posted 03 January 2013 - 06:46 AM

LOL--so basically no way to change that software directly because it's written sux, huh? I distinctly remember being able to add servers to a list along with Apple's servers in earlier OS incarnations. Apparently it's another way of Apple wanting more control--we still can paste server names into the box, but can't save. I wonder how many people would do other than just choose an apple server and let it go at that.

Like I said, my programming skills on the Mac are nil--I'd be very interested and very grateful for that "dueling list" idea of yours! again--my Thanks!

0

#8 User is offline   bastion 

  • Power User
  • PipPipPipPip
  • Group: Members
  • Posts: 9,272
  • Joined: 14-October 04

Posted 03 January 2013 - 12:42 PM

View Postnonjunk, on 03 January 2013 - 06:46 AM, said:

LOL--so basically no way to change that software directly because it's written sux, huh? I distinctly remember being able to add servers to a list along with Apple's servers in earlier OS incarnations. Apparently it's another way of Apple wanting more control--we still can paste server names into the box, but can't save. I wonder how many people would do other than just choose an apple server and let it go at that.

Like I said, my programming skills on the Mac are nil--I'd be very interested and very grateful for that "dueling list" idea of yours! again--my Thanks!


The list was definitely editable prior to OS X. I don't think that particular preference pane has changed substantially in the last decade, though.

I got the UI to my replacement utility roughed out this morning before work. It seems like a fairly straightforward project.

Even if the addresses weren't hard-coded, you wouldn't be able to change the resources in place because there's still the signed code issue. This configuration is really something that would've had to be designed in there.
0

#9 User is offline   nonjunk 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 31-December 12

Posted 03 January 2013 - 12:57 PM

Well, it was worth a shot. :) As my friend said, I could report it as an issue to Apple and maybe in a decade or so they might change it to something a bit more user-friendly.

Looking forward to your finished work and giving it a try. Appreciate it!

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users