Skip to main content

Questions tagged [timezone]

When using or applying a TZ value.

Filter by
Sorted by
Tagged with
189 votes
7 answers
319k views

How can I have `date` output the time from a different time zone?

I have a server running with the time zone set to UTC. It seemed like that was generally a good practice (please correct me if I'm wrong). Anyhow, one of the servers I connect to, in order to scp ...
cwd's user avatar
  • 45.9k
184 votes
3 answers
715k views

Timezone setting in Linux [closed]

I'm setting the timezone to GMT+6 on my Linux machine by copying the zoneinfo file to /etc/localtime, but the date command is still showing the time as UTCtime-6. Can any one explain to me this ...
Rahul Dhobi's user avatar
  • 2,047
41 votes
2 answers
79k views

Can date format current time for GMT timezone? [duplicate]

When I run date +"%Y%m%d%H%M%S" I receive 20171225203309 here in CET time zone. Can I use date to obtain a the current time in the same format, but for timezone GMT?
Drux's user avatar
  • 557
39 votes
3 answers
64k views

How can I examine the contents of /etc/localtime?

What command(s) can I use to examine the contents of the timezone files, such as /etc/localtime or the files under /usr/share/zoneinfo/*?
slm's user avatar
  • 373k
34 votes
1 answer
5k views

Error message "date: invalid date '2016-10-16'"

Today my clock was automatically adjusted to summer time, and a script from a crontab started failing. I had a look at what was happening, and the following error was being displayed, with LC_ALL=C: ...
admirabilis's user avatar
  • 4,762
32 votes
4 answers
24k views

Why does TZ=UTC-8 produce dates that are UTC+8?

The current time in Los Angeles is 18:05. But when I run TZ=UTC-8 date --iso=ns, I get: 2013-12-07T10:05:37,788173835+0800 The date utility tells me that the time is 10:05, and even says that it's ...
Alex Henrie's user avatar
27 votes
3 answers
89k views

Changing timezone on Debian keeps Local Time in UTC

I'm trying to get programs to log in local time for my own sanity. I have updated my timezone with: dpkg-reconfigure tzdata But the result of that command is: Current default time zone: '...
complistic's user avatar
27 votes
1 answer
3k views

Why is `TZ=Asia/Kolkata date --date="1/1/1906"` invalid?

When I run: TZ=Asia/Kolkata date --date="1/1/1906" I get: date: invalid date ‘1/1/1906’ Here I can find a good article on that: Calcutta Time But the confusion also comes from the fact ...
15 Volts's user avatar
  • 2,119
25 votes
4 answers
8k views

Should I (still) use UTC for all my servers?

My employer is located in Europe (CET), and therefore we use daylight saving time, which requires shifting an hour hence and forth twice a year. Our servers are running in the cloud in different ...
Patrick Bucher's user avatar
25 votes
4 answers
24k views

Automatically set Linux timezone according to location

How can we automatically set the system default timezone in Linux using the Internet? As I see it, NTP servers can update only time, but not timezone. Is there any server that can change the timezone?
Embedded Programmer's user avatar
23 votes
2 answers
54k views

How to list timezones known to the system?

I would like to have a list of all the timezones in my system's zoneinfo database (note : system is a debian strecth linux) The current solution I have is : list all paths under /usr/share/zoneinfo/...
LeGEC's user avatar
  • 335
18 votes
6 answers
15k views

How to add a custom timezone clock to an XFCE panel?

My local time is CET (Prague, EU), I also need to see UTC and, some times, MSK time. Can I add multiple clocks with different zones to a panel in XFCE? I know how to add multiple clocks, actually, but ...
Ivan's user avatar
  • 18k
17 votes
3 answers
20k views

How do I get the current time in a different time zone without changing system time? [duplicate]

I am trying to use 'date' to get the time in a different time zone, and failing. All the methods I've found on google involve changing the time zone on the system, but that is not what I want. Is ...
ID-ZERO's user avatar
  • 331
16 votes
2 answers
31k views

How to change the user timezone?

I know that (for example in Debian) one could use dpkg-reconfigure tzdata to change the timezone of the system but I am wondering how one could change the user timezone (if Linux/Unix supports such an ...
Loax's user avatar
  • 355
16 votes
2 answers
9k views

What's the difference between localtime and timezone files?

I'm setting up a docker container and there are two places where the timezone are set: /etc/localtime /etc/timezone Can anybody explain me what's the difference between them and what are both used ...
CarlosAS's user avatar
  • 283
14 votes
3 answers
42k views

How can I easily change my time-zone in Arch/Xfce?

Since I move around, I need to be to change time-zones frequently. I'm on Arch/Xfce. How can I do that? I've tried right click on the watch on the top panel -> properties -> time settings -> time zone....
Johshi's user avatar
  • 463
14 votes
1 answer
14k views

Cron job does not fire up after a timezone change

I've tried eliminating many of the common errors, ensuring that the PATHs are available for cron there is an endline at the end of crontab file the timezone is set-up by: cd /etc cp /usr/share/...
adsisco's user avatar
  • 243
13 votes
1 answer
28k views

What is /etc/timezone used for?

On my Manjaro linux box, I have a file /etc/timezone which contains: Asia/Bangkok Another Manjaro forum user also has the same file. That thread on the whole contains some prior art on this question....
Tom Hale's user avatar
  • 31.5k
13 votes
2 answers
5k views

Why is zone.tab missing so many time zones?

There are over a thousand time zone files on your typical *nix box (in /user/share/zoneinfo). Many of them vary only in historical dates which have little relevance for programs which care only about ...
Jonathan M Davis's user avatar
12 votes
1 answer
12k views

How to disable DST changes for a timezone?

My system timezone is Asia/Tehran, and it has DST changes adjusts in Summer (spring forward) and fall back in Winter; however I do need to disable these DST adjustments and keep timezone always in UTC+...
αғsнιη's user avatar
  • 41.6k
12 votes
1 answer
2k views

How does `at` know there will be a time change?

I happened to be twiddling around with at just yesterday at 2:40 AM. (Don't ask...) I tried scheduling events one minute in the future (as a test), and – it just didn't happen. The events were in the ...
leftaroundabout's user avatar
11 votes
5 answers
50k views

Configure localtime. dpkg-reconfigure tzdata

I'm using this to configure localtime: dpkg-reconfigure tzdata It is ncurses interface. I'm looking for the way to programming this. Is there true way without user ncurses interface? How to ...
unixlinuxuser's user avatar
11 votes
5 answers
18k views

Change the time zone of a cronjob

I have a cronjob which is executes every day at 9:00 AM of UTC-Time. I'm in GMT+1 so it executes at 10:00 AM local time. When there is the timezone change (to daylight saving time, DST), the cronjob ...
qailburn's user avatar
  • 113
10 votes
1 answer
4k views

Run an application with different TimeZone

I have an windows application (Under Wine) that only works when I change timezone to NewYork's TimeZone. with Any other zone it doesn't start!! So, Is it possible in Linux to run an application with ...
Ariyan's user avatar
  • 2,126
9 votes
3 answers
14k views

Disable daylight saving time in Debian Linux

I do not want my system to use daylight saving time. root@ali-debserver:~# cat /etc/timezone Asia/Tehran root@ali-debserver:~# cat /etc/default/rcS # # /etc/default/rcS # # Default settings for the ...
alireza's user avatar
  • 377
9 votes
3 answers
18k views

`timedatectl set-timezone` doesn't update `/etc/timezone`

I expected that timedatectl would update /etc/timezone when changing timezones, but no: % sudo timedatectl set-timezone 'Asia/Kuala_Lumpur' % cat /etc/timezone Asia/Bangkok Is there a reason that it ...
Tom Hale's user avatar
  • 31.5k
9 votes
1 answer
2k views

Incorrect automatic time zone

I've noticed that the automatic time zone detection functionality of my GNOME 3 (Arch Linux) is not working correctly. My actual time zone is PST (UTC-08), but if I toggle on the "Automatic Time ...
Zizheng Tai's user avatar
8 votes
1 answer
3k views

Different timestamps in SFTP "ls -l" vs. "ls -lh"

I have a 3rd-party SFTP server on which I want to check some file timestamps. However, I do get different results for the same file if I use ls -l vs. ls -lh: sftp> ls -l [...] -rwxrwxrwx 1 0 ...
Florian Brucker's user avatar
8 votes
2 answers
27k views

How to get the timezone of a FTP server?

With lftp, when I do ls I get the listing of the files on the FTP server, with their date. However, the timezone is not displayed. On my local machine, I can do ls -l --time-style=full-iso to see ...
augustin's user avatar
  • 463
8 votes
2 answers
8k views

Get current timezone as `Region/City`

Unfortunately timedatectl set-timezone doesn't update /etc/timezone. How do I get the current timezone as Region/City, eg, given: % timedatectl | grep zone Time zone: Asia/...
Tom Hale's user avatar
  • 31.5k
8 votes
2 answers
10k views

setting a cronjob in IST time

I am trying to set a cronjob run in a different timezone. I've googled a lot and found editing /etc/default/cron is the way to go. But this file is deprecated and I see the following message, so I ...
tesster's user avatar
  • 81
7 votes
1 answer
4k views

How to correct wrong time zone offset via zic timezone compiler

I have an iPod touch (2nd gen) running iOS 3.1.3 (since it won't perform well with iOS 4) and constant troubles with the clock setting itself one hour ahead of the actual time when I connect it to the ...
leugim's user avatar
  • 241
6 votes
2 answers
2k views

How can I set a time zone on a Linux machine that has only very minimal cmds available?

I have a Linux machine that only has very minimal cmds available on it, for example the /bin looks like this: /bin# ls ash chattr clockdiff dd dumpkmap ...
Henry's user avatar
  • 205
6 votes
3 answers
10k views

Is my BST time zone an hour behind?

My system (Gnome 3 on Debian Testing) is confused about the current time. When I run date the time is showing correctly but some applications are an hour behind the times. For instance, when I add an ...
rkhff's user avatar
  • 835
6 votes
3 answers
5k views

What else apart from /etc/localtime and $TZ affects `date`?

I have a fedora 20 installation with the clock set to UTC, and no TZ environment variable. Why the date command is outputting the date in the CET timezone (which by the way is my local timezone)? [...
Carlos Campderrós's user avatar
6 votes
1 answer
1k views

hg log timezone formatting

For hg, I can set formatting with --template key to output only date, like this: > hg log -l1 --template "{date(date, '%Y-%m-%d %H:%M:%S')}\n" 2016-10-07 10:22:41 I can use %z control to output ...
FunkyCat's user avatar
  • 171
6 votes
1 answer
10k views

Set environment variable (TZ) for all startup scripts and inittab

I'm working on an embedded Linux system and looking for a way to set the time zone for all processes. The question is: Is there any possibility to set the TZ environment variable at boot time (init ...
Klaus's user avatar
  • 63
6 votes
2 answers
1k views

My crontab only likes five asterisks (timezone related?)

I have a problem with a user's crontab. Crontab refuses to run any job unless it's scheduled to run every minute (* * * * *). An soon as you edit the task to run, say, on minute 15 of every hour, it ...
Tulains Córdova's user avatar
5 votes
2 answers
6k views

/etc/shadow date of last password change—UTC or local time?

man 5 shadow gives the following description of the third field in each line: The date of the last password change, expressed as the number of days since Jan 1, 1970. The value 0 has a special ...
me_and's user avatar
  • 1,152
5 votes
1 answer
1k views

PST to PDT changes on April 1st instead of March 11 at 2:00am?

I got the complaint that PST time zone is one hour ahead for Washington in my embedded device. I'm using tz utility to setup the timezone. This is the Los Angeles time zone : 2018 Sun, Mar 11 at ...
danglingpointer's user avatar
5 votes
3 answers
4k views

Linux: Set timezone offset that doesn't exist?

Is it possible on any Linux to force a timezone offset that is outside the "valid" range -12 to +14? I'm looking for a way to temporarily simulate a "local time" (for testing purposes) that might be ...
kbluck's user avatar
  • 153
5 votes
1 answer
2k views

Querying the current time of a city from terminal

I have friends all over the globe and before calling them I need to know their current time. Is there an application in Linux where one can query a city (if exists) in terminal (something like this): ...
sterz's user avatar
  • 824
5 votes
1 answer
673 views

How to change the timezone on CentOS 7?

Does anyone know how to change the timezone on CentOS 7?
Michael Balash's user avatar
5 votes
4 answers
11k views

Get current timezone on CentOS 7?

On previous version of CentOS, I used the following command to get the current timezone in my bash script: timezone=$(sed 's/ZONE=//g' /etc/sysconfig/clock) Output is "America/New_York" How can I ...
user2650277's user avatar
5 votes
1 answer
17k views

How to have time synchronization work on localtime?

The Arch wiki suggests Time standard Recommended: Set both Arch Linux and Windows to use UTC, following Time#UTC in Windows. Also, be sure to prevent Windows from synchronizing the time on-line, ...
Tobias Kienzler's user avatar
5 votes
1 answer
15k views

Why does `date` show UTC time, even with a different timezone set?

I'm running Raspbian on a Pi 2. While I'm not sure this behavior was different previously, running date outputs the same time as date -u, despite my timezone being UTC-7. Below is the output of both ...
Nightfirecat's user avatar
5 votes
1 answer
4k views

How to make awesomewm textclock reflect timezone change?

I am using the awful.widget.textclock widget to display the time in Awesome WM on Arch Linux, and I am using a program called tzupdate to automatically update my system time according to geolocation ...
JKav77's user avatar
  • 161
5 votes
2 answers
1k views

Setting timezone globally for OpenIndiana Hipster?

What is the correct way of setting the timezone (CentralEuropeanTime... or now rather CET with Daylight Savings Time) on the latest version of OpenIndiana Hipster? I've tried a changing a few ...
Baard Kopperud's user avatar
4 votes
5 answers
10k views

How to make an Ubuntu time zone change stick?

I'd like to reset the timezone through editing /etc/timezone. However, after I was done editing and saved the file, the system time did not change accordingly. On the other hand, when I take ...
Terry Li's user avatar
  • 1,955
4 votes
4 answers
6k views

Identify current default time zone set in FreeBSD

I know sudo tzsetup will prompt me to change time zone settings on FreeBSD. ➥ How can I see the current time zone settings, without making changes? I know date shows me current time. For example: ...
Basil Bourque's user avatar

1
2 3 4 5 6