Questions tagged [date]
154 questions
7
votes
1 answer
Is it possible to set the date on a Linux machine to the year 2040?
I need to be able to set the date on Ubuntu (8.04.4 LTS) to the year 2040 (to test something that isn't relevant to this question). Is that possible?
I can run:
$ sudo date -s "15 JAN 2038 18:00:00"
Fri Jan 15 18:00:00 PST 2038
...but:
$ sudo date…

Daryl Spitzer
- 2,996
- 9
- 33
- 40
6
votes
2 answers
CentOS not considering daylight saving on timezone
In Brazil, this year, the president decided we should not have daylight saving. And because of that my Centos 8 server is with the time wrong, I mean, when I use date the time shown is wrong by 1 hour. Usually, when I set my server I execute…

Samul
- 308
- 2
- 12
6
votes
4 answers
How to tell if a file is older than 30 minutes on AIX?
I'd like to write a shell script in ksh or bash which exits with 1 if a specific file is older than 30 minutes. (Last modification time is older than half hour).
It would be easy on a Linux or a modern unix, but I have to do it on AIX 5.2…

csadam
- 188
- 2
- 8
5
votes
7 answers
What format are DMARC dates?
I have a DMARC report that includes:
1500249600
1500335999
How do I convert the dates to something human?

Greg Pagendam-Turner
- 973
- 2
- 13
- 20
5
votes
3 answers
Is an ntpdate correction atomic?
I've got the following in /var/log/syslog, from yesterday (July 30th)
Dec 16 22:54:05 omap ntpdate[432]: step time server 91.189.94.4 offset 12052648.821465 sec
ntpdate 91.189.94.4 "corrected" my clock from July 30th to December 16th! According to…

Peter Woo
- 53
- 3
5
votes
2 answers
date +%s glitches
I have a strange issue I'm starting to troubleshoot and wondered if anyone would have any helpful tips.
I have a cronjob executed every minute that executes a script and appends the output to a file on a filer. The job prints the current timestamp…

RnR
- 153
- 6
5
votes
3 answers
date -d: what are the accepted strings?
I am using the "date" command to perform some simple date arithmetic. The "-d" option lets me do this, but the man pages are very unclear on what is valid data. What are all the accepted options, and how do I figure that out?
I can use this command…

curious_george
- 174
- 1
- 8
5
votes
5 answers
Cannot access client pc remotely due to time/date issue xp win2k3 environment -- REMOTE solution please
When I run psexec to the user desktop (xp pro) I get "There is a time and/or date difference between the client and the server." I also get "access denied" when I run the at \clientname time /interactive "net time \server /set /y" command. I cannot…

Detritus Maximus
- 336
- 2
- 4
- 14
5
votes
2 answers
Linux get UTC offset from current (or other) timezones on given date and time
In Chile the case is very particular as the days of daylight saving changes are different a year from another...
Is there a function to get for given day at given UTC time the UTC offset?
I saw on a Suse documentation that something like zdump -v…

Philippe Gachoud
- 1,687
- 16
- 21
4
votes
2 answers
bash: convert date from to unix timestamp changes timestamp
Running the following command at the xen-servers (either DOM0 or DOMU) at $company gives me a negativ number, on every other system zero (0) (even in my cygwin).
date -d "1970-01-01T00:00:00" "+%s"
$TZ is unset, /etc/localtime is the same file as…

killermoehre
- 43
- 1
- 4
4
votes
1 answer
date command displays different time
I have one centos 5.8 Linux server. I am experiencing a bit strange issue and figured out it is something with system time. When I check date command, outputs are really strange. Here is example:
[root@web ~]# date
Thu Feb 19 21:21:59 JST…

mask8
- 169
- 5
4
votes
5 answers
ntpdate not updating system time in XenServer VM
We have a Debian webserver that I am trying to use ntpdate to keep the time in sync.
When I run
ntpdate ntp0.cs.mu.oz.au
I receive
16 Sep 10:55:36 ntpdate[21626]: step time server 128.250.36.2 offset 318.914011 sec
With no errors, which should be…

LukeR
- 3,126
- 2
- 30
- 25
4
votes
3 answers
SFTP files not showing upload date as last modification time
Some of the files we receive on our Redhat server are showing date different from upload date as the last modification time. For us the modification time is important as we classify files depending on date we receive it. Some of these file show…

nitins
- 2,579
- 15
- 44
- 68
4
votes
7 answers
How to create a yesterday date in a batch
copy \\server01\E$\LogFiles\IVR\bcR\??120428.* \\LBC\workgroup\cs\ftp\Team\bcR\
copy \\server02\E$\LogFiles\IVR\bcR\??120428.* \\LBC\workgroup\cs\ftp\Team\bcR\
copy \\server03\E$\LogFiles\IVR\bcR\??120428.* \\LBC\workgroup\cs\ftp\Team\bcR\
copy…

Joe
- 41
- 1
- 1
- 2
4
votes
3 answers
How do I set current Unix time in milliseconds?
Possible Solution
date --set="2011-12-07 01:20:15.962" && date --rfc-3339=ns
Original Question
I can get the date with milliseconds like so:
date +"%S.%N"
date --rfc-3339=ns
According to man date I would expect to be able to set it like so:
date…

coolaj86
- 951
- 2
- 10
- 19