How can i make the date command output yesterday's date, current date and the date 4 days ago, in the following format:
Code:
2012-10-03
code:
Code:
date +% ????
Hi,
I need subtract two date values (which are in day of the year format) and the output would give the remaining days. using the command date +"%j" i would get today's 'day of the year' i.e.,
Code:
> date +"%j"
256
Next, i need to take input of a previous date in the format 09/05/2012 and then convert it to 'day of the year format'.
Hi,
When I use the `date' command on RHEL5, I can get the time shown in 24 hr format. I wonder if the time can be shown in 12 hr format. But I don't want to use the `date +FORMAT' to do that, neither `alias date='date +FORMAT''. I just want a simple `date' to show time in 12hr format.
Is there any configuration file about the 12/24 hr format?
I have a CSV file with a date format like this;
11/19/2012 17:37:00,1.372,121.6
11/19/2012 17:38:00,0.743,121.6
Want to change the time stamp to seconds after 1970 so I can get the data in rrdtool.
Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
Code:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Moderator's Comments:
Given a date and time in a format that is not recognized by date, how can I get date to recognize the date and time?
For example:
$ date -d "09SEP2012:23:58:46"
date: invalid date `09SEP2012:23:58:46'
$ date -d "09SEP2012:23:58:46" --magic-option "ddMMMYYY:hh:mm:ss"
Sun Sep 9 23:58:46 MDT 2012
Does --magic-option exist?
My web-scraping scripts have long enjoyed using date -d to read in human-formatted time and date stamps like "March 11, 1999" and convert to any other format I need via the -s parameter.
How might I get it to understand dates printed in other locales like 27 Kwi, 13:54 in Polish?
I got a statement like below to subtract 1 from given date using teradata.
I got a statement like below to subtract 1 from given date using teradata.