# Changing date/time on the device

**URL:** <https://forums.balena.io/t/changing-date-time-on-the-device/2089>\
**Category:** Product support\
**Tags:** time\
**Created:** [October 27, 2017, 7:14pm UTC](https://forums.balena.io/t/changing-date-time-on-the-device/2089 "2017-10-27T19:14:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradstewart](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bradstewart](https://forums.balena.io/u/bradstewart)\
**Post date:** [October 27, 2017, 7:14pm UTC](https://forums.balena.io/t/changing-date-time-on-the-device/2089/1 "2017-10-27T19:14:45Z")

</div>

How would I go about changing the system date from inside my container? I have a lot of time-dependent code, and changing the system time is the easiest way to test things.

`date -s "27 OCT 2017 7:44:00"` doesn’t persist.

Thanks,  
Brad

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [October 27, 2017, 8:29pm UTC](https://forums.balena.io/t/changing-date-time-on-the-device/2089/2 "2017-10-27T20:29:41Z")

</div>

Hi, the devices are running the NTP service (systemd-timesync) to set up the correct time. I’m guessing that time syncing is the part that doesn’t make your changes stick.

Just tried it out, and in the host OS, I see in the logs I can see the `systemd[1]: Time has been changed` entries that resets to the correct time after issuing the command you posted.

If you need to test with setting the time, would suggest the following:

- use the `.dev` version of resinOS for your development, which opens up the system more
- when you have the `.dev`, you can log into the host OS using the [resin-cli](https://github.com/resin-io/resin-cli): for example `resin local ssh --host <IP>`
- stop the time synchronization (with `systemctl stop systemd-timesyncd`)
- do your time manipulation inside the user container as you’ve mentioned… 🕰

Some extra notes: this will work only on your local network (due to the the `resin local ssh`); and do not use `.dev` devices in production, they are open access by default, only for development; changing the time might have effect on other parts of the system which is good to keep in mind when debugging.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![bradstewart](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bradstewart](https://forums.balena.io/u/bradstewart)\
**Post date:** [October 30, 2017, 6:24pm UTC](https://forums.balena.io/t/changing-date-time-on-the-device/2089/4 "2017-10-30T18:24:39Z")

</div>

Working great, thanks!
