# Change container's year

**URL:** <https://forums.docker.com/t/change-containers-year/58880>\
**Category:** General\
**Tags:** docker\
**Created:** [September 20, 2018, 8:44am UTC](https://forums.docker.com/t/change-containers-year/58880 "2018-09-20T08:44:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![colotiline](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/colotiline/32/21067_2.png) [@colotiline](https://forums.docker.com/u/colotiline)\
**Post date:** [September 20, 2018, 8:44am UTC](https://forums.docker.com/t/change-containers-year/58880/1 "2018-09-20T08:44:07Z")

</div>

Hi.

**Setup**

- Stable Docker 18.06.1-ce-win73 (19507).
- CentOS container ([https://hub.docker.com/\_/centos/](https://hub.docker.com/_/centos/)).

**The problem**  
I can’t change the system year (I need to use 2049). How to do it? For now I only learned how to change the timezone, but I need to change the year.

---

<div class="post-metadata">

**Author:** ![colotiline](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/colotiline/32/21067_2.png) [@colotiline](https://forums.docker.com/u/colotiline)\
**Post date:** [September 20, 2018, 8:44am UTC](https://forums.docker.com/t/change-containers-year/58880/2 "2018-09-20T08:44:58Z")

</div>

I can’t change host time because I don’t have permissions.

---

<div class="post-metadata">

**Author:** ![jjfraney](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jjfraney](https://forums.docker.com/u/jjfraney)\
**Post date:** [September 20, 2018, 9:54am UTC](https://forums.docker.com/t/change-containers-year/58880/3 "2018-09-20T09:54:35Z")

</div>

There is no ‘time namespace’ in containers. [https://en.wikipedia.org/wiki/Linux\_namespaces#time\_namespace](https://en.wikipedia.org/wiki/Linux_namespaces#time_namespace)

In other words, container and the host get time from the same kernel variables (without getting into how time imaintained).

But while you might not have direct privilege to change the time, your containers may have such depending on how docker is configured. A host may allow containers to run as uid 0 (root). If this is true for your environment, then you can avoid the privilege problem.

I’m not going to try it on my own system to confirm, but something like this can work on a host that allows containers to run as root:

docker run --rm alpine date 092010102018

---

<div class="post-metadata">

**Author:** ![colotiline](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/colotiline/32/21067_2.png) [@colotiline](https://forums.docker.com/u/colotiline)\
**Post date:** [September 20, 2018, 9:59am UTC](https://forums.docker.com/t/change-containers-year/58880/4 "2018-09-20T09:59:04Z")

</div>

Unsuccessful.

date: can’t set date: Operation not permitted
