Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [date-utility]

The tag has no usage guidance.

1
vote
0answers
15 views

Timestamp retrived with `date -r file` does not fit the time order of commands [duplicate]

I was playing around with the command date to create timestamps and profile the execution of a script. I decided to set four of them, named t1 through t4. For t2 I created an empty file whose last ...
0
votes
1answer
55 views

Is there a way to restrict the application access to the system time in linux?

Is there a way to restrict the application access to the system time in linux? I want to make the application launch as much as possible abstracted from the environment. If you can restrict access to ...
-1
votes
1answer
93 views

How can a linux process's date and time be updated without restarting? [closed]

I have a requirement where date and timestamp of a server has to be changed frequently to desired value and associated processes (Weblogic server/Java Virtual Machine Process and a script) have to ...
0
votes
3answers
68 views

Cascading Date Manipulation and Precedence [duplicate]

echo 20171231 | xargs -i date -d "{} +1 day" | xargs -i date -d "{} -1 month" **Fri Dec 1 00:00:00 PST 2017** In this case, when date formatting commands are pipelined I am get Dec 1. echo 20171231 ...
1
vote
1answer
2k views

Date string to epoch in bash

How can I get the epoch if I have a string in the following format? 1/30/2017 11:14:55 AM The following does not work: $ date -j '1/30/2017 11:14:55 AM' +'%m/%d/%Y %H:%M:%S' date: illegal time ...
1
vote
1answer
56 views

Why is one of these date commands valid and the other not?

[user@mymachine folder]$ echo `date --date=tomorrow +%Y%m%d` 20160802 [user@mymachine folder]$ echo `date -d=tomorrow +%Y%m%d` date: invalid date `=tomorrow' I'm using Centos 5 if that makes any ...
3
votes
2answers
612 views

how does the gnu coreutils `date` work? [closed]

I did not see any similar questions on this site. The manpage, while helpful in describing how to use date, did not have much background info. Even the info page (as prescribed in the manpage: info '(...
0
votes
2answers
113 views

FreeBSD date utility -r switch confuses me

I have a bash script which I need to convert from linux to FreeBSD, but I'm obviously too stupid to read the man page in a proper way. The script has a line along: date +%d -r "$file" which works ...
0
votes
1answer
56 views

Add n days to a date token

My issue as follows: consider I have a token $d=20140607 and I want to add 7 days to it. I tried date -d "$d+7 days" but it is not working. It throws this error date: invalid date `20160407+7days' ...
1
vote
1answer
1k views

how to log command start time and command end time in txt file using cygwin

I can save and view the cygwin console output (stdout and stderr) using the following command, python command.py 2>&1 | tee -a outFile.txt// Note -a is for appending since I have different ...