Questions tagged [timezone]

When using or applying a TZ value.

Each place on earth has a local time, that local time is set by the value of the timezone used relative to the Zero time (UTC). There are more than 500 localtimes (zones that keep the same local time) but only about 40 Time Zones (some countries use 30 minutes offsets).

237 questions
186
votes
7 answers

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 files, is running on EDT and stores files that I need…
cwd
  • 44,479
  • 71
  • 146
  • 167
183
votes
3 answers

Timezone setting in Linux

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 behavior? I'm assuming the date command should display…
Rahul Dhobi
  • 2,037
  • 3
  • 14
  • 11
40
votes
2 answers

Can date format current time for GMT timezone?

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
  • 547
  • 1
  • 5
  • 8
36
votes
3 answers

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
  • 363,520
  • 117
  • 767
  • 871
34
votes
1 answer

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: date: invalid date '2016-10-16' I though it…
admirabilis
  • 4,642
  • 9
  • 41
  • 57
31
votes
4 answers

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 reporting it as UTC+8. Why?
Alex Henrie
  • 715
  • 1
  • 8
  • 13
27
votes
3 answers

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: 'Australia/Adelaide' Local time is now: Mon May 20…
complistic
  • 373
  • 1
  • 3
  • 7
27
votes
1 answer

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 that 1905 was a valid date. Only 1906 wasn't. Any clue why?
15 Volts
  • 1,969
  • 2
  • 19
  • 34
25
votes
3 answers

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?
25
votes
4 answers

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 locations. The employee who set up all the…
Patrick Bucher
  • 775
  • 6
  • 15
20
votes
2 answers

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/posix, which are either plain files or symlinks cd…
LeGEC
  • 305
  • 1
  • 2
  • 7
18
votes
6 answers

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 how to customize time zone of each of them?
Ivan
  • 17,368
  • 35
  • 93
  • 118
17
votes
3 answers

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

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 there a single command that will return current time…
ID-ZERO
  • 331
  • 1
  • 2
  • 5
15
votes
2 answers

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 for?
CarlosAS
  • 273
  • 3
  • 7
15
votes
2 answers

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 idea at all). I normally work on the server…
Loax
  • 345
  • 2
  • 3
  • 8
1
2 3
15 16