Questions tagged [date-utility]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
198 views

Why does `date` ignore TZ environment variable?

On Ubuntu 18.04, I have the following behavior of date: $ date --version | head -n1 date (GNU coreutils) 8.28 $ date Вт окт 8 13:18:18 MSK 2019 $ TZ=UTC date Вт окт 8 10:18:23 UTC 2019 So far so ...
1
vote
1answer
201 views

Get current date and time in standard ISO 8601 format on console in FreeBSD

I would like to get the current date-time conveniently on the console in standard ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ For example: 2019-07-13T01:09:35Z I know the date command displays the current ...
1
vote
0answers
17 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
206 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
288 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
89 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
3k 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
57 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
943 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
153 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
63 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 ...