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?
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 +% ????
the following was taken from a perl script:
Code:
my $date = strftime "%B %d %H:%M:%S", localtime;
how can i modify it so this date outputs the date in the form of the date of the messages file.
I'm trying to display a specific date in unix, using the date command, I can't figure out how to display a date other than today's date.
For example, if I was trying to display "July 4, 2011"
I use $date +"%B %d, %Y"
But I keep getting today's date in that format. How can I change it so that it displays the date I want?
Thanks.
We had a network problem a couple of days before that caused 1 interface to down and up.
I'm trying to display a specific date in Unix, using the date command, I can't figure out how to display a date other than today's date.
For example, if I was trying to display July 4, 2011 I use
$ date +"%B %d, %Y"
But I keep getting today's date in that format. How can I change it so that it displays the date I want?
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip:
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip: