macoscocoashellmacos-carbonsystem-preferences

Where the Date Time preferences data is saved on mac


I need to check whether "set Date and Time automatically" is checked or not on mac system preferences programmatically .

I didn't find any preferences plist file that it contains about this information,Can anybody suggest me from where can I fetch this information.

Thanks.


Solution

  • Actually I was trying to find that whether ntpd process is running or not at runtime.

    This ntpd process can be started manually when the user checks set Date and Time automatically in System Preferences and stops when it is unchecked.

    So,I was trying to find a flag that is writing in the system plist files.I did not find any.So I tried querying ntpd process state with lauchctl from the command line.

    There by I could able to find the ntpd state.