Changing Date using date command along with time zone
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
How to change the date using date
command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )
date
add a comment |Â
up vote
0
down vote
favorite
How to change the date using date
command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )
date
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How to change the date using date
command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )
date
How to change the date using date
command along with changing the time zone. Since "IST" as time zone is not setting to Indian standard time (which is UTC +05:30) (I am looking for a solution specific to CentOS 7 )
date
edited Mar 15 at 8:51
asked Mar 15 at 7:35
Ashwin Geet D'Sa
32
32
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47
add a comment |Â
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ
environment variable to a value such as Asia/Calcutta
(on a user-by-user basis), or by setting the system's timezone. The date
command is not used for setting the timezone.
Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata
. On OpenBSD it is done by creating a symbolic link from /etc/localtime
to the correct timezone file under /usr/share/zoneinfo
(e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
).
add a comment |Â
up vote
0
down vote
When setting the date with date
, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.
In short: date
is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ
environment variable to a value such as Asia/Calcutta
(on a user-by-user basis), or by setting the system's timezone. The date
command is not used for setting the timezone.
Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata
. On OpenBSD it is done by creating a symbolic link from /etc/localtime
to the correct timezone file under /usr/share/zoneinfo
(e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
).
add a comment |Â
up vote
0
down vote
accepted
In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ
environment variable to a value such as Asia/Calcutta
(on a user-by-user basis), or by setting the system's timezone. The date
command is not used for setting the timezone.
Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata
. On OpenBSD it is done by creating a symbolic link from /etc/localtime
to the correct timezone file under /usr/share/zoneinfo
(e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
).
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ
environment variable to a value such as Asia/Calcutta
(on a user-by-user basis), or by setting the system's timezone. The date
command is not used for setting the timezone.
Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata
. On OpenBSD it is done by creating a symbolic link from /etc/localtime
to the correct timezone file under /usr/share/zoneinfo
(e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
).
In most Unices, the system clock should be set to UTC time. The timezone should then be set to the appropriate value by either setting the TZ
environment variable to a value such as Asia/Calcutta
(on a user-by-user basis), or by setting the system's timezone. The date
command is not used for setting the timezone.
Setting the system's timezone may be done differently on different Unices. On Ubuntu, it is done through the command dpkg-reconfigure tzdata
. On OpenBSD it is done by creating a symbolic link from /etc/localtime
to the correct timezone file under /usr/share/zoneinfo
(e.g. /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta
).
answered Mar 15 at 7:44
Kusalananda
103k13201318
103k13201318
add a comment |Â
add a comment |Â
up vote
0
down vote
When setting the date with date
, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.
In short: date
is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?
add a comment |Â
up vote
0
down vote
When setting the date with date
, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.
In short: date
is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?
add a comment |Â
up vote
0
down vote
up vote
0
down vote
When setting the date with date
, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.
In short: date
is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?
When setting the date with date
, it changes the time stored by the system RTC, which does not store timezone information. It's up to the OS to interpret the RTC time as being in some timezone or the other. Linux typically assumes the RTC time is in UTC, Windows typically assumes it's in the local timezone. So, when setting the time in Linux, if you give it time in IST, it will usually convert it to UTC and then store the UTC timestamp in the RTC.
In short: date
is the wrong command for setting the timezone. The appropriate command would likely depend on which specific OS or distribution you are using. See, for example: How to change the timezone on CentOS 7?
answered Mar 15 at 7:45
Olorin
1,15711
1,15711
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430334%2fchanging-date-using-date-command-along-with-time-zone%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Please mention distro and version in body to get precise answer specific to your issue.
â Nikhil_CV
Mar 15 at 7:47