can I use the NTP server to pull time for different time zones for devices solely on WIFI? Without explicitly setting a time zone?

I was working to create a JS to sync time zone based on IP, for devices that are WIFI only and will be in one working group in SOTI but in different time zones physically. Can I use the NTP to set this and maybe add some JS with it to get the right time zone? 

a year ago
SOTI Assist
ANSWERS
A
ATMOD@SOTI
a year ago

Hi Katie,

 

Thanks for posting on SOTI Pulse.

You can use an NTP (Network Time Protocol) server to synchronize the time on Wi-Fi-only devices in SOTI MobiControl, and you can complement this with JavaScript to adjust the time zone based on the IP address when the devices are in different time zones.

Here's how you can approach this:

  1. Configure NTP for Time Synchronization:

    • Go to the MobiControl console and set up the devices to synchronize their time with an NTP server. This will ensure that regardless of the device's physical location, the time is accurately maintained.
  2. Implement JavaScript for Time Zone Adjustment:

    • You can create a JavaScript script that determines the device's current IP address, then uses that to determine the correct time zone. With this information, you can then set the device's time zone accordingly.
  3. Combining Both:

    • Set the JavaScript to run after the NTP synchronization to ensure that the correct time is first established before adjusting the time zone.

For additional details on how to configure time synchronization policies and utilize JavaScript scripting in SOTI MobiControl, you can refer to the documentation here: SOTI MobiControl Time Synchronization and check the scripting capabilities in SOTI MobiControl relevant to your version.

 

Incase of any further concerns, please don't hesitate to reach out.

 

Kind Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

KW
Katie Williams Bronze Contributor
a year ago

Thank you so much for this!

Question, would it be better to grab NTP time for all the devices and then add JS to set the time zone based on IP/LOCATION or would I want to grab the time from my deployment server (so would set EST time/time zone for everyone) and then add JS to set the time zone for anything that is not EST?? I hope that makes sense. 

A
ATMOD@SOTI
a year ago

Hi Katie,

In your scenario, it would generally be more effective to grab the time from your NTP (Network Time Protocol) server for a couple of reasons:

  1. Accuracy: Using an NTP server ensures that all devices are synchronized to the correct time and can adjust for any discrepancies in timekeeping due to lag or drift on the devices themselves.

  2. Local Time Zone Adjustments: By retrieving the accurate time and then using JavaScript (JS) to set the time zone based on IP/location, each device can operate according to its local time zone. This is particularly important if your devices are distributed across multiple time zones. It allows you to keep a consistent reference time (UTC from NTP) and apply local adjustments dynamically.

  3. Flexibility: Setting the time zone based on the device’s location or IP address provides flexibility. This way, if a device is moved to a different time zone, it can automatically adjust without the need for manual reconfiguration.

  4. Reduction in Overhead: Using a central NTP server can also reduce the load on your deployment server and lessen potential synchronization conflicts, especially when managing a large number of devices.

Given this rationale, your approach of grabbing the NTP time for all devices and using JS to adjust for the local time zone would be ideal.

Conclusion

In summary, the better approach would be to retrieve the correct time from an NTP server and adjust for local time zones based on the device's IP/location.

Kind Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

Similar Discussions