Questions tagged [date]
the "date" tag is used to classify questions about date/calendar/time manipulation, visualisation, conversion... on Unix-like systems.
1,193 questions
14 votes
2 answers
2k views
What is that "T" in the pattern string of the date-command?
What is that "T" in the pattern string of the date-command? While there is decent information about the output format string, I can only find unexplained examples for the pattern string ( ...
3 votes
2 answers
194 views
Get all log lines from last minute with busybox
I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute. The logs are like this: Tue Jun 3 11:06:43 2025 authpriv.info dropbear[...
3 votes
1 answer
286 views
Help needed for command to avoid leading zero in month part
We are using command find $$dirpath_err -maxdepth 1 -type f -name "*XYZJPQ*_"`date +%m_%d_%Y`"*standard_error.csv" but the file is generated as ...
0 votes
1 answer
129 views
What output does --iso-8601=ns provide with the date command?
This command will output the following: date --iso-8601=ns 2025-04-04T12:10:16,045431370+02:00 According to man date the ns is documented as follows: -I[FMT], --iso-8601[=FMT] output date/time in ...
0 votes
2 answers
128 views
time in bash prompt does not change over time
I changed the prompt in my .bashrc to show the current time. This was the original prompt (from a fresh MX Linux install) PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc " and I ...
3 votes
2 answers
428 views
How to compare two dates in formats %Y-%m-%dT%H:%M:%S.%3NZ and %-m/%-d/%Y %-I:%M %p
This is a bash date conversion/comparison question. How do I compare dates $d1 and $d2 below where: $d1 has format %-m/%-d/%Y %-I:%M %p (US-style %p with AM/PM) and $d2 has format %Y-%m-%dT%H:%M:%S.%...
2 votes
1 answer
214 views
Locale: Unable to get correct date (for Sunday of this week)
I did the following yesterday night (before midnight of Sunday in Germany): Today's date $ LC_TIME="en.GB.UTF8" date --iso-8601 2025-01-12 Today's date (day of the week $ LC_TIME="en....
0 votes
3 answers
290 views
How to show seconds of last modified date when using sftp command?
When I use WinSCP to access my SFTP server, it shows me the last modified (changed) date including seconds. If I use sftp on Linux and run ls -l, it only shows the hours and minutes, but no seconds. ...
4 votes
1 answer
386 views
ISO 8601 intervals in date arithmetic with date command
I can make some date arithmetic with date command like $ date -u -d '3 days 2024-12-01T00:00:00Z' +%FT%H:%M:%SZ 2024-12-04T00:00:00Z $ The date command can parse quite a lot of date formats, ...
1 vote
2 answers
103 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?
0 votes
2 answers
200 views
speedtest cli with cron and date
I would like a cron job running every hour for speedtest cli and to log it to csv file with time and date (https://www.speedtest.net/apps/cli). So I can run it this way 0 * * * * speedtest -p no -f ...
0 votes
1 answer
79 views
adding alternate date (e.g., julian) to Gnome panel
Is there an extension which would allow me to add an additional date (Julian) to the Gnome panel?
3 votes
3 answers
334 views
How to use associative array in Bash to get the current time in multiple locations?
I want to create a Bash script that outputs the following: Chile: 03:46am, Friday, 27 September, 2024 Tierra Del Fuego: 03:46am, Friday, 27 September, 2024 Falkland Islands: 03:46am, Friday, 27 ...
4 votes
2 answers
451 views
Invalid date when setting one computer's clock from another
I have the following code in a Bash script, which takes the current date/time and sets it via SSH on a target computer: ssh <user>@<target> "date --set '$(date)'" This was ...
0 votes
1 answer
226 views
How to set keyboard shortcut to insert a timestamp (time & date) in KWrite?
KWrite is included as the default text editor in several popular Linux distros (such as Fedora KDE). Inserting a timestamp is a basic feature of text editors. How can one set a keyboard shortcut to ...