the "date" tag is used to classify questions about date/calendar/time manipulation, visualisation, conversion... on Unix-like systems.

learn more… | top users | synonyms

1
vote
4answers
288 views

How to get the last five business days in a Unix shell script using a `for` loop?

The following script: BUSSINESS_DATE=`date -d "-2 day" +"%Y%m%d"` for (( c=0; c<5 ; c++ )) do WEEKDAY=`date --date="$BUSINESS_DATE -$c day" +%w` if [ $WEEKDAY == "0" ] then ...
1
vote
3answers
323 views

Excluding specific date and time in cronjob

I am trying to schedule a cron job where the requirement is the job has to run every day, every month and every min and every hour EXCEPT 2nd and 4th sunday of every month from 1 to 3 AM. Is there a ...
1
vote
2answers
231 views

How to get proper format from date for the touch -A argument?

I would like to change all of the attribute times of some files to the immediate date. It appears that I would need to use touch -A * (more or less; realizing that I am going to use a more complex ...
3
votes
1answer
159 views

Why does “date” show different times in root and user?

Using dpkg-reconfigure tzdata I have set my timezone to CST, but for non root users the system persists in using UTC time. pi@raspberry ~ $ date Wed Oct 28 18:14:08 UTC 2015 ...
0
votes
1answer
29 views

How to implement config file expiration time?

I have a Debian server which runs a service using multiple config files (in a similar way to apache2) which I need to add an expiration date to. The config file that has an expiration date starts with ...
0
votes
1answer
24 views

How to see the lines whose date column is less than x day from today

My file ID=29524 02/12/2015,23:59:34,'PAt, 0, ID=29628 02/12/2015,23:59:37,'PAb, 1.9, ID=30816 03/12/2015,00:00:20,'PAc, 4.15, I would like to print files with X days less than from today. My try ...
0
votes
1answer
65 views

How to find files that were most recently created on file system?

I am trying to track the completion of a silent installer by detecting the presence of the last file created by it, but in order to do that I need to find out which file that is. Is there any way to ...
0
votes
1answer
328 views

I'm trying to compile alsa-driver-RTv5.18 but get date-time error for gcc 4.9.2

/home/user/Downloads/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18/alsa/acore/info.c:1065:22: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time] "Compiled on " __DATE__ " for ...
0
votes
1answer
49 views

Issues with storing an echo of a date conversion into a string variable inunix

Apologies but this question comes from a question previously raised: How can I convert a local date-time into UTC date-time? Toby has been absolutely great helping me with some conversion string-->BST ...
0
votes
1answer
288 views

Modify date in email header using script with mailx

I am trying to modify a script which grabs data from a database and puts it into the message of an email which is then sent out using mailx. What I need to do is grab the date which is in the first ...
3
votes
0answers
184 views

Best practice to customize date/time format system-wide?

I'd like to customize exclusively the date and time format for my system, while sticking to the rest of the locale as is. I know that environment variable LC_TIME will make it possible to customize ...
3
votes
0answers
110 views

How do I recursively set the date created attribute to the date modified attribute on NTFS-3G?

In my first question, I asked how to get the "Date created" field in NTFS-3G. Now, that I know I can get the "Date created", I have started adding files onto my NTFS-3G partition and would like to set ...
1
vote
0answers
40 views

date/time setting does not work after unplugging power adapter or sudden power cut

For some reason, I want to configure the date/time in my Linux (CentOS 6.5) to be different from the REAL date/time, but the setting won't work if I turn my computer(desktop not laptop if this ...
1
vote
0answers
293 views

Changing the date format of auth.log

I was looking to change the date format in which auth.log logs information. I could not find a way to do it. Is there a method to do this? My system uses rsyslog.
0
votes
0answers
18 views

How to change the date format in the LXDM login/greeting screen (LXDE)

I found a number of resources to change the system (Archlinux 2016-03-01) date format, amongst others one to create a new format from an existing locale file. I then modifed /etc/environment and ...
0
votes
0answers
67 views

Reset time / date to current time-zone using timedatectl preferably, or date

As the title says, I'm looking to reset the current system time to the selected time-zone using the timedatectl preferably, or date command. This is on the CentOS 7 OS, hence the timedatectl ...
0
votes
0answers
35 views

date advancing quickly ubuntu 14

after an upgrade of my server from ubuntu 12.04 LTS to ubuntu 14.04 LTS my system date is advancing quickly (taking 1h every 10 minutes). I tryied to install an ntp server to correct date but no way ...
0
votes
0answers
81 views

reading dates from process substitution using awk. Issue with field separator, splitting tokens incorrectly

I have the following code, thanks to @Janis for the help with the process substitution. Also, apologies for creating a new question, I haven't received any recent replies on the thread of my previous ...
0
votes
0answers
53 views

Get first day of the month

I need to get the first day of the month in this format "%y%m%d" or 150301 I can get the current day in this format: date +"%y%m%d" But the first day of the month is a lot trickier. Any thoughts? ...