Questions tagged [timezone]
When using or applying a TZ value.
256 questions
2
votes
3
answers
244
views
Choose timezone in now() Ansible function
This Ansible Jinja template function
now(utc=true,fmt="%H:%M:%S")
allows to get the current timestamp in the specified format, in UTC.
How can one get the timestamp in their local, or ...
0
votes
0
answers
19
views
During toolchain installation, when glibc gets installed, it reports an error message
During toolchain installation, when glibc gets installed, it reports an error message
zic: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or ...
1
vote
2
answers
90
views
Can any Linux date command print the current time in a time zone other than the current?
I want the just the current time in HH:MM (%R or %H:%M in strftime) in a time zone other the my system's.s
Is this possible with just the date command, and if so, how?
3
votes
2
answers
165
views
MinGW/MSys 2 doesn't seem to recognize TZ environment variable
I work on a legacy system originally written in C for 3b2 SVR3, later in C++ for Sun/Solaris, now mainly for Linux. We have a few users who require our apps to run on Windows Servers, so we have ...
0
votes
1
answer
409
views
Cron time zone won't work on an AWS based EC2 instance
I have an EC2 instance that runs linux. The timezone is set to UTC time and I need my cron tasks to work on UK timezone. However, I am unable to change the system clock to the UK timezone. It must ...
3
votes
1
answer
157
views
how to execute cron jobs based on user's time zones
I'm facing challenges in implementing a cron job for our daily check-in feature. Our goal is to send a push notification alarm daily to remind users to check in if they haven't already. The timing of ...
0
votes
2
answers
109
views
Change special hh mm to another time zone
I want to change 0710 (07 hour 10 minute in GMT +0)
to 0810 (08 hour 10 minute in GMT +1)
what command in linux can do it?
Thank you for your support !
1
vote
1
answer
366
views
Add hours to the date and time
I have a requirement to add offset hours to the datetime value.
Get the previous date (e.g. 2023-10-19 00:00:00.000000)
previous_date=`TZ=TZ+24 date '+%Y-%m-%d 00:00:00.000000'`
Calculate the ...
-1
votes
1
answer
362
views
Dualboot | After synced time on windows linux time is wrong
After i synced the windows time my hardware clock time is bad.
timedatectl
Local time: Sun 2023-10-01 15:38:05 CEST
Universal time: Sun 2023-10-01 13:38:05 UTC
...
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 ...
2
votes
3
answers
691
views
For what do you need to change hardwareclock and how?
I started Linux server (Amazon Linux 2) from scratch.
I'm in Tokyo locale and I changed timezone info like this;
ll /etc/localtime
# lrwxrwxrwx 1 root root 25 Feb 22 10:11 /etc/localtime -> ../usr/...
4
votes
3
answers
1k
views
Why is there a difference between timezone America/Chicago (CST6CDT) and Etc/GMT-6?
Here is my code:
#include <time.h>
#include <stdio.h>
time_t my_timegm (struct tm *tm, char *tz_offset);
int
main (void)
{
struct tm time_tm;
time_t start_timet, end_timet;
...
25
votes
4
answers
9k
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 ...
1
vote
4
answers
19k
views
Hardware and System clock both wrong in linux
I dual booted my laptop and installed EndeavourOS (while other OS being windows 10)
Due to this, my hardware and system clock both show the wrong time.
I have set the correct time zone (UTC+5:30), ...
1
vote
1
answer
1k
views
Use a different timezone for one cron job?
I have multiple cron jobs in one crontab (as usual). One of the jobs interacts with a remote system in another timezone, which means I need to adjust the crontab every time either timezone enters or ...
2
votes
1
answer
2k
views
How to change the time zone string of date command?
I'm curious about how to change the abbreviation of time zone shown by date command.
Let the time zone unchanged, but how to change CST below to UTC+8?
clay@LAPTOP-3PP2093I:~$ date
Thu Dec 1 23:05:28 ...
1
vote
1
answer
56
views
Can `cal` show other Gregorian adoptions?
On my host I can show the adoption of the Gregorian calendar as it occurred for Great Britain and its colonies in 1752:
$ cal september 1752
September 1752
Su Mo Tu We Th Fr Sa
1 2 ...
5
votes
2
answers
16k
views
How do I make cron use UTC?
My local time zone is not UTC; How do I make cron use UTC for it's schedule without changing time zone on the computer in other aspects?
1
vote
1
answer
362
views
zdump and date do not show the same daylight saving information
I am using my localtime set to be Israel.
I updated the system clock and hardware clock, and using zdump I get:
~# zdump /usr/share/zoneinfo/Israel
/usr/share/zoneinfo/Israel Wed Apr 20 16:11:36 2022 ...
13
votes
1
answer
14k
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+...
2
votes
1
answer
5k
views
Format datetime as UTC with strftime (for use in git)
I can format dates and time pretty flexibly with strftime, but from what I can see, this only will give times in my local timezone; I can add the timezone offset (e.g. '%Y %m %d-%H:%M:%S%z' for a ...
8
votes
1
answer
4k
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 ...
3
votes
0
answers
471
views
How to check/set "kernel timezone" for use with iptables "time" module?
The iptables -m time module supports time-based firewall rules. By default it operates in UTC but with --kerneltz parameter it should work in "kernel timezone":
$ iptables -m time --help
...
0
votes
1
answer
3k
views
How to know when was the last time I changed the time zone?
I changed my time zone recently but can't recall which day. Is there a way to know what is the date that I changed my time zone?
1
vote
1
answer
514
views
hwclock's output is effected by DST when entering it, but not when leaving it
I set system time and RTC to the following values.
date -s 2021.08.30-09:59:30 >/dev/null 2>/dev/null //set system time
hwclock -w //sync RTC to system time
Also, /etc/TZ (which is the same ...