How to change time-zone settings from the command line
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a virtual machine that is set to PST that a couple of colleagues have in different time-zones.
If I wanted to change the time-zone to EST and GMT, what do I need to do?
command-line time timezone
add a comment |
I have a virtual machine that is set to PST that a couple of colleagues have in different time-zones.
If I wanted to change the time-zone to EST and GMT, what do I need to do?
command-line time timezone
add a comment |
I have a virtual machine that is set to PST that a couple of colleagues have in different time-zones.
If I wanted to change the time-zone to EST and GMT, what do I need to do?
command-line time timezone
I have a virtual machine that is set to PST that a couple of colleagues have in different time-zones.
If I wanted to change the time-zone to EST and GMT, what do I need to do?
command-line time timezone
command-line time timezone
edited 2 days ago
daaawx
1053
1053
asked Aug 31 '10 at 18:19
manyxcximanyxcxi
1,23621415
1,23621415
add a comment |
add a comment |
10 Answers
10
active
oldest
votes
Use timedatectl
sudo timedatectl set-timezone <timeszone>
Examples:
Timezone as EST
sudo timedatectl set-timezone EST
Timezone as UTC
sudo timedatectl set-timezone UTC
Listing all valid Timezones
timedatectl list-timezones
This command is perfect for automation scripts since it doesn't require any user interaction while compared to the other given answer based on dpkg-reconfigure tzdata
.
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know whattzdata
does, how it works, but I don't need to with this one line command). Thanks!
– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
this didn't work for me; however thedpkg-reconfigure
did the trick.
– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
|
show 7 more comments
As root you have to execute:
dpkg-reconfigure tzdata
A menu based tool should be started that allows you to change the timezone.
add a comment |
The following also work. For GMT:
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
For EST:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
add a comment |
The most ease way especially to a server is to list timezones:
timedatectl list-timezones
And choose yours, for example:
timedatectl set-timezone Europe/Athens
Thats it! , :-)
add a comment |
To run one program with a different time zone setting, set the TZ
environment variable, e.g. run TZ=Pacific/Kiritimati date
to see what time it is on Christmas Island, or export TZ=Pacific/Kiritimati
to have the setting last for a shell session.
add a comment |
Edit the timezone
file at the /etc
folder as:
Etc/GMT
You can use the next format:
Region "/" City
Example of /etc/timezone
:
Europe/Athens
or
Europe/Paris
Europe/London
You may experiment with the: dpkg-reconfigure tzdata
and check cat the timezone file.
You must reboot or start again a service (not the ntp service). I do not know which one.
If somebody knows please share with us.
(Tested on Ubuntu 15.10 the change is taken into account instantly)
add a comment |
cp -p /usr/share/zoneinfo/US/Pacific /etc/localtime
I recommend AGAINST linking like mentioned by others. If some script accidentally over writes your /etc/localtime
file, then it overwrites your Pacific timezone file... and it's a bit of a pain to replace it.
Just copy the Pacific file over the localtime file with the command above.
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
add a comment |
I use the following script to ask the user which timezone to set, and then confirm it has indeed been set:
#!/bin/sh
sudo timedatectl set-timezone $(tzselect)
echo
echo timedatectl says:
timedatectl
I call it tz-set
.
add a comment |
As root you have to execute:
ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
add a comment |
This worked for me on GCP Ubuntu 14 via SSH
sudo su
cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
- Restart the server
- Done
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f3375%2fhow-to-change-time-zone-settings-from-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
10 Answers
10
active
oldest
votes
10 Answers
10
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use timedatectl
sudo timedatectl set-timezone <timeszone>
Examples:
Timezone as EST
sudo timedatectl set-timezone EST
Timezone as UTC
sudo timedatectl set-timezone UTC
Listing all valid Timezones
timedatectl list-timezones
This command is perfect for automation scripts since it doesn't require any user interaction while compared to the other given answer based on dpkg-reconfigure tzdata
.
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know whattzdata
does, how it works, but I don't need to with this one line command). Thanks!
– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
this didn't work for me; however thedpkg-reconfigure
did the trick.
– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
|
show 7 more comments
Use timedatectl
sudo timedatectl set-timezone <timeszone>
Examples:
Timezone as EST
sudo timedatectl set-timezone EST
Timezone as UTC
sudo timedatectl set-timezone UTC
Listing all valid Timezones
timedatectl list-timezones
This command is perfect for automation scripts since it doesn't require any user interaction while compared to the other given answer based on dpkg-reconfigure tzdata
.
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know whattzdata
does, how it works, but I don't need to with this one line command). Thanks!
– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
this didn't work for me; however thedpkg-reconfigure
did the trick.
– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
|
show 7 more comments
Use timedatectl
sudo timedatectl set-timezone <timeszone>
Examples:
Timezone as EST
sudo timedatectl set-timezone EST
Timezone as UTC
sudo timedatectl set-timezone UTC
Listing all valid Timezones
timedatectl list-timezones
This command is perfect for automation scripts since it doesn't require any user interaction while compared to the other given answer based on dpkg-reconfigure tzdata
.
Use timedatectl
sudo timedatectl set-timezone <timeszone>
Examples:
Timezone as EST
sudo timedatectl set-timezone EST
Timezone as UTC
sudo timedatectl set-timezone UTC
Listing all valid Timezones
timedatectl list-timezones
This command is perfect for automation scripts since it doesn't require any user interaction while compared to the other given answer based on dpkg-reconfigure tzdata
.
edited Jun 16 '18 at 13:23
answered Mar 8 '15 at 13:15
Jossef HarushJossef Harush
2,8371916
2,8371916
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know whattzdata
does, how it works, but I don't need to with this one line command). Thanks!
– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
this didn't work for me; however thedpkg-reconfigure
did the trick.
– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
|
show 7 more comments
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know whattzdata
does, how it works, but I don't need to with this one line command). Thanks!
– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
this didn't work for me; however thedpkg-reconfigure
did the trick.
– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
1
1
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know what
tzdata
does, how it works, but I don't need to with this one line command). Thanks!– Phil Ryan
Jun 1 '15 at 23:21
Not a fan of +1 comments, but am putting one here since this worked for me in the best way. I was wanting a single one-line command line tool to change the timezone, rather than wanting to launch some whole either menu or gui program (I don't know what
tzdata
does, how it works, but I don't need to with this one line command). Thanks!– Phil Ryan
Jun 1 '15 at 23:21
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
works like a charm ;)
– user332660
Feb 24 '16 at 10:01
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
Interestingly, it is doing something a little different than tzdata. I had an issue with Java time being different than the system time after applying a patch. Tzdata didn't work to fix the issue, but this did.
– Daniel Bower
Mar 23 '16 at 15:54
1
1
this didn't work for me; however the
dpkg-reconfigure
did the trick.– Antti Haapala
Apr 10 '16 at 11:39
this didn't work for me; however the
dpkg-reconfigure
did the trick.– Antti Haapala
Apr 10 '16 at 11:39
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
14.04.4 ubuntu server
– Antti Haapala
Apr 10 '16 at 11:44
|
show 7 more comments
As root you have to execute:
dpkg-reconfigure tzdata
A menu based tool should be started that allows you to change the timezone.
add a comment |
As root you have to execute:
dpkg-reconfigure tzdata
A menu based tool should be started that allows you to change the timezone.
add a comment |
As root you have to execute:
dpkg-reconfigure tzdata
A menu based tool should be started that allows you to change the timezone.
As root you have to execute:
dpkg-reconfigure tzdata
A menu based tool should be started that allows you to change the timezone.
edited Apr 13 '15 at 14:06
Freek de Bruijn
1114
1114
answered Aug 31 '10 at 19:41
maxschlepzigmaxschlepzig
1,93931930
1,93931930
add a comment |
add a comment |
The following also work. For GMT:
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
For EST:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
add a comment |
The following also work. For GMT:
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
For EST:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
add a comment |
The following also work. For GMT:
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
For EST:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
The following also work. For GMT:
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
For EST:
ln -sf /usr/share/zoneinfo/EST /etc/localtime
edited Aug 5 '14 at 14:34
user100464
19819
19819
answered Aug 31 '12 at 10:09
pm_labspm_labs
40143
40143
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
add a comment |
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
8
8
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
I think it would be better to link one of the city files rather than GMT or EST, as then they will keep track of daylight savings time, whereas linking (e.g.) GMT will not change the system time to reflect when daylight savings is in effect in your city. e.g.:
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
– Asfand Qazi
Jun 8 '15 at 9:19
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
this is the best
– Hasan Tıngır
Oct 17 '18 at 12:48
add a comment |
The most ease way especially to a server is to list timezones:
timedatectl list-timezones
And choose yours, for example:
timedatectl set-timezone Europe/Athens
Thats it! , :-)
add a comment |
The most ease way especially to a server is to list timezones:
timedatectl list-timezones
And choose yours, for example:
timedatectl set-timezone Europe/Athens
Thats it! , :-)
add a comment |
The most ease way especially to a server is to list timezones:
timedatectl list-timezones
And choose yours, for example:
timedatectl set-timezone Europe/Athens
Thats it! , :-)
The most ease way especially to a server is to list timezones:
timedatectl list-timezones
And choose yours, for example:
timedatectl set-timezone Europe/Athens
Thats it! , :-)
answered Feb 18 '16 at 15:52
DimitriosDimitrios
24123
24123
add a comment |
add a comment |
To run one program with a different time zone setting, set the TZ
environment variable, e.g. run TZ=Pacific/Kiritimati date
to see what time it is on Christmas Island, or export TZ=Pacific/Kiritimati
to have the setting last for a shell session.
add a comment |
To run one program with a different time zone setting, set the TZ
environment variable, e.g. run TZ=Pacific/Kiritimati date
to see what time it is on Christmas Island, or export TZ=Pacific/Kiritimati
to have the setting last for a shell session.
add a comment |
To run one program with a different time zone setting, set the TZ
environment variable, e.g. run TZ=Pacific/Kiritimati date
to see what time it is on Christmas Island, or export TZ=Pacific/Kiritimati
to have the setting last for a shell session.
To run one program with a different time zone setting, set the TZ
environment variable, e.g. run TZ=Pacific/Kiritimati date
to see what time it is on Christmas Island, or export TZ=Pacific/Kiritimati
to have the setting last for a shell session.
answered Sep 1 '10 at 0:04
GillesGilles
45.5k13102142
45.5k13102142
add a comment |
add a comment |
Edit the timezone
file at the /etc
folder as:
Etc/GMT
You can use the next format:
Region "/" City
Example of /etc/timezone
:
Europe/Athens
or
Europe/Paris
Europe/London
You may experiment with the: dpkg-reconfigure tzdata
and check cat the timezone file.
You must reboot or start again a service (not the ntp service). I do not know which one.
If somebody knows please share with us.
(Tested on Ubuntu 15.10 the change is taken into account instantly)
add a comment |
Edit the timezone
file at the /etc
folder as:
Etc/GMT
You can use the next format:
Region "/" City
Example of /etc/timezone
:
Europe/Athens
or
Europe/Paris
Europe/London
You may experiment with the: dpkg-reconfigure tzdata
and check cat the timezone file.
You must reboot or start again a service (not the ntp service). I do not know which one.
If somebody knows please share with us.
(Tested on Ubuntu 15.10 the change is taken into account instantly)
add a comment |
Edit the timezone
file at the /etc
folder as:
Etc/GMT
You can use the next format:
Region "/" City
Example of /etc/timezone
:
Europe/Athens
or
Europe/Paris
Europe/London
You may experiment with the: dpkg-reconfigure tzdata
and check cat the timezone file.
You must reboot or start again a service (not the ntp service). I do not know which one.
If somebody knows please share with us.
(Tested on Ubuntu 15.10 the change is taken into account instantly)
Edit the timezone
file at the /etc
folder as:
Etc/GMT
You can use the next format:
Region "/" City
Example of /etc/timezone
:
Europe/Athens
or
Europe/Paris
Europe/London
You may experiment with the: dpkg-reconfigure tzdata
and check cat the timezone file.
You must reboot or start again a service (not the ntp service). I do not know which one.
If somebody knows please share with us.
(Tested on Ubuntu 15.10 the change is taken into account instantly)
edited May 2 '16 at 2:26
philipper
5311
5311
answered Jul 28 '14 at 12:19
chasapis.christoschasapis.christos
6111
6111
add a comment |
add a comment |
cp -p /usr/share/zoneinfo/US/Pacific /etc/localtime
I recommend AGAINST linking like mentioned by others. If some script accidentally over writes your /etc/localtime
file, then it overwrites your Pacific timezone file... and it's a bit of a pain to replace it.
Just copy the Pacific file over the localtime file with the command above.
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
add a comment |
cp -p /usr/share/zoneinfo/US/Pacific /etc/localtime
I recommend AGAINST linking like mentioned by others. If some script accidentally over writes your /etc/localtime
file, then it overwrites your Pacific timezone file... and it's a bit of a pain to replace it.
Just copy the Pacific file over the localtime file with the command above.
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
add a comment |
cp -p /usr/share/zoneinfo/US/Pacific /etc/localtime
I recommend AGAINST linking like mentioned by others. If some script accidentally over writes your /etc/localtime
file, then it overwrites your Pacific timezone file... and it's a bit of a pain to replace it.
Just copy the Pacific file over the localtime file with the command above.
cp -p /usr/share/zoneinfo/US/Pacific /etc/localtime
I recommend AGAINST linking like mentioned by others. If some script accidentally over writes your /etc/localtime
file, then it overwrites your Pacific timezone file... and it's a bit of a pain to replace it.
Just copy the Pacific file over the localtime file with the command above.
edited Sep 26 '18 at 22:30
abu_bua
4,18981630
4,18981630
answered Jul 18 '17 at 20:04
J RoysdonJ Roysdon
411
411
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
add a comment |
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
This actually worked for me. I think there's some bug with Docker, ansible (?). Both timedatectl and dpkg-reconfigure tzdata failed for me. After I copied, the time zone changed from EST to PDT.
– Sun
Jun 12 '18 at 15:25
add a comment |
I use the following script to ask the user which timezone to set, and then confirm it has indeed been set:
#!/bin/sh
sudo timedatectl set-timezone $(tzselect)
echo
echo timedatectl says:
timedatectl
I call it tz-set
.
add a comment |
I use the following script to ask the user which timezone to set, and then confirm it has indeed been set:
#!/bin/sh
sudo timedatectl set-timezone $(tzselect)
echo
echo timedatectl says:
timedatectl
I call it tz-set
.
add a comment |
I use the following script to ask the user which timezone to set, and then confirm it has indeed been set:
#!/bin/sh
sudo timedatectl set-timezone $(tzselect)
echo
echo timedatectl says:
timedatectl
I call it tz-set
.
I use the following script to ask the user which timezone to set, and then confirm it has indeed been set:
#!/bin/sh
sudo timedatectl set-timezone $(tzselect)
echo
echo timedatectl says:
timedatectl
I call it tz-set
.
answered Apr 26 '18 at 7:24
Tom HaleTom Hale
1,55921127
1,55921127
add a comment |
add a comment |
As root you have to execute:
ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
add a comment |
As root you have to execute:
ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
add a comment |
As root you have to execute:
ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
As root you have to execute:
ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
answered Mar 19 at 10:30
Stefan SebastianStefan Sebastian
1
1
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
add a comment |
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
Please explain at least how this command works to change the timezone.
– Parto
Mar 19 at 17:15
add a comment |
This worked for me on GCP Ubuntu 14 via SSH
sudo su
cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
- Restart the server
- Done
add a comment |
This worked for me on GCP Ubuntu 14 via SSH
sudo su
cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
- Restart the server
- Done
add a comment |
This worked for me on GCP Ubuntu 14 via SSH
sudo su
cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
- Restart the server
- Done
This worked for me on GCP Ubuntu 14 via SSH
sudo su
cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime
- Restart the server
- Done
answered Mar 24 at 22:41
Vignesh ChinnaiyanVignesh Chinnaiyan
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f3375%2fhow-to-change-time-zone-settings-from-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown