67
votes
Accepted
Why is the year in this ISO timestamp not 2019?
Most of the google hits show CODEBUILD_START_TIME being represented as the number of milliseconds since 1970. I suspect somewhere in your code you are treating that as if it were seconds.
If you ...
37
votes
Accepted
What time zone is a cron job using?
Cron job uses the server's define timezone (UTC by default) which you can check by typing the date command in terminal.
All countries timezones are defined in /usr/share/zoneinfo directory:
cd /usr/...
34
votes
Accepted
How to set system time dynamically in a Docker container
It is possible
The solution is to fake it in the container. This lib intercepts all system call programs use to retrieve the current time and date.
The implementation is easy. Add functionality to ...
12
votes
Sync ntp immediately at boot with undiciplined clock
You can use the -g parameter. From the manpage:
-g
Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the ...
11
votes
What time zone is a cron job using?
If you have may users, with many crontabs and they have different time zone requirements, you cannot just change system timezone.
But you still can set a specific time zone to be used just for the ...
10
votes
dmesg time vs system time time isn't correct
To get accurate times for "recent" entries in dmesg, you could convert the dmesg timestamps to real time with some hacking of the output.
By "recent", I mean times after the last ...
10
votes
dmesg time vs system time time isn't correct
Workaround is journalctl with -k, --dmesg. I am using -k as it is shorter:
journalctl -k
It will show only kernel messages and correct time.
To show only kernel lines matching phrase:
journalctl -kg ...
9
votes
Accepted
MySQL logs different time than NOW()
Solution was super simple: look through the variables and try to locate relevant:
log_timestamps | UTC
So I changed it to 'SYSTEM':
mysql> SET GLOBAL log_timestamps = 'SYSTEM'...
8
votes
What time zone is a cron job using?
While the accepted answer is correct, I would like to add a correction to the verification.
The accepted answer says you can verify the system time by typing date in the terminal.
When I type date, it ...
8
votes
Docker - Timezones in containers not same as on host
You should be able to set timezone in your containers by using tzdata :
docker run -e TZ=Europe/Amsterdam debian:jessie date
Credits and further explanation to "Why containers don't sync time with ...
7
votes
How do I force sync the time on Windows Workstation or Server?
change your time server
w32tm /config /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org" /syncfromflags:manual /update
fore update time
w32tm /resync /force
7
votes
What time zone is a cron job using?
Unless you know a priori what time zone cron is running in, the only reliable solution is to check empirically. Otherwise, you might just be checking the time zone of your current shell environment, ...
6
votes
How to convert 'dmesg' time format to 'real' time format
I know this is now old but dmesg now has a built in -e or --reatime option to display the time in the local time.
root@bbs:/var/log# dmesg|tail -1
[50755952.379177] Out of memory in UB 1593: OOM ...
6
votes
How do I force sync the time on Windows Workstation or Server?
Powershell one liner if ntp server is configured:
gsv w32time | sasv; w32tm /resync /force
You can put this .bat file in the startup if you CMOS batery failed so it can resync upon OS start:
@...
6
votes
Turn OFF NTPD immediatly synchronization
By default, ntpd will step (instead of slew) the time if the offset is greater than 128ms. You can avoid that with the -x command line option, but beware: Correcting one second of offset will take ...
6
votes
What is the minimum annual overhead required to admin an On-Premises Exchange Server
A data point.
I manage about 24 Exchange servers for customers now, and spend about 2 hours per month on mail-related issues which may include SSL certificates, user management, managing the ...
6
votes
Incorrect Ubuntu server time
How to keep accurate time on Ubuntu continuously?
By enabling the ntpd service and running it continuously.
I synchronized it using sudo ntpdate -s time.nist.gov few months ago but it jumped ...
6
votes
Incorrect Ubuntu server time
Unfortunately Ubuntu hasn't added the disclaimer from NTP.org's ntp-4.2.*\html\ntpdate.html manual to Ubuntu's ntpdate(8) manpage, like for example FreeBSD has:
ntpdate - set the date and time via ...
6
votes
Accepted
Redhat Enterprise Linux 7: How to disable DST - Daylight Saving Time
You don't disable DST per se, you set the desired time zone, and you get DST if the time zone has DST.
You can check the configured time zone with timedatectl.
If your timezone has DST you'll see ...
6
votes
Sync ntp immediately at boot with undiciplined clock
In addition to the -g flag described above, you should add iburst to the server line on the clients. This will cause them to sync more quickly to the server.
However, you can't expect your server ...
5
votes
How do I force sync the time on Windows Workstation or Server?
OS: MS Windows 7
All above ideas have been tried but did not help. The original problem still exists: "The computer did not resync because the required time change was too big."
Solution is found in ...
5
votes
Is PTP really more precise than NTP? If so, why?
Yes, it seems possible in principle that NTP can approach PTP. Although, if the requirement is simply sub-second accuracy, NTP can do that over nearly any network.
NTP can be very precise, the ...
5
votes
System time is off by up to hundreds of milliseconds despite NTP sync before boot
I do not have numbers to produce, but it seems probable that the interface used to set the clock at boot only has precision down to the second.
You do not state your OS, but on all Unix-like systems ...
5
votes
Accepted
Why is my internal clock always 1.3 seconds off?
Turns out w32time simply sucks. Microsoft admitted that
w32time cannot reliably maintain sync time to the range of 1 to 2 seconds.
Great software guys...
I installed a different implementation ...
5
votes
Accepted
Windows Server 2022 Time Service Jumping into the future
UPDATE: Ars Technica has written an article on this problematic feature: https://arstechnica.com/security/2023/08/windows-feature-that-resets-system-clocks-based-on-random-data-is-wreaking-havoc/
TL;...
4
votes
Why is ntpd not updating the time on my server?
If ntpd wouldn't be able to connect with the remote server, you
wouldn't see an offset for that server.
If ntpq would be blocked by ntpd, you would see a clear error message from ntpq.
If some other
...
4
votes
How do I get the current Unix time in milliseconds in Bash?
Another solution for MacOS: GNU Coreutils
I have noticed that the MacOS' version of the date command is not interpreting the %N format sequence as nanoseconds but simply prints N to the output when I ...
4
votes
Accepted
Incorrect Ubuntu server time
Install ntp package
sudo apt-get install ntp
Edit /etc/ntp.conf for your neighbor ntp server
sudo vi +/^server /etc/ntp.conf
Reload ntp configuration
sudo service ntp reload
Check time sync status ...
4
votes
How much clock asynchronicity can secure protocols tolerate?
I've heard 5 minutes thrown around several times as per EEAA's comment, but I honestly don't know why (and am looking forward to an explanation).
Bear in mind this is not the TLS protocol itself that ...
4
votes
Centos Linux stuck in time
Your peers might be reachable by ping, but they aren't reachable by NTP, which is the important thing for clock sync. You may have a local, network, or ISP-level firewall blocking access.
However, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
time × 484ntp × 120
linux × 103
windows × 67
time-synchronization × 64
timezone × 44
date × 36
ubuntu × 29
ntpd × 24
centos × 21
windows-server-2008 × 20
cron × 19
windows-server-2003 × 17
clock-synchronization × 17
active-directory × 15
unix × 15
debian × 14
bash × 13
mysql × 12
domain-controller × 12
windows-server-2012 × 11
synchronization × 11
amazon-ec2 × 10
hyper-v × 9
scripting × 9