I got a statement like below to subtract 1 from given date using teradata.
How can I convert any user inputted date into yyyy/mm/dd?
For example user can input date in one of the following formats 20120121 , 2012-01-21, 01/21/2012, 01/21/2012 etc.
But I need to convert any of the date entered by user into yyyy/mm/dd (2012/01/2012). How?
This is the script I was using , but it is not working.
echo "Please enter the date: "
read X
a=$X+"%y/%m/%d"
echo $a
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'.
I'm looking for a way to have the "date" command output the date in a specific format.
I'm not familiar with the different ways to use the date command at all.
How can I convert any user inputted date into yyyy/mm/dd?
For example, the user may input date in one of the following formats:
20120121
2012-01-21
01/21/2012
01/21/2012
...
But I need to convert any of the date entered by the user into yyyy/mm/dd (2012/01/2012).
Code:
echo "1337124526" | perl -pe 's/(\d+)/easttime($1)/e'
the above gives a date and time.
how can i subtract the date and time given by this command, from the current present date?
can this be a one liner or as close to a one-liner as possible?
i have a log file that has the date and time that looks like this:
Code:
Wed Jun 28 15:46:21 2012 test failed tailed passed passed not error panic
what we want to focus on is the first 5 columns because they contain the date and time.
the date and time can be anywhere on the line. in this particular case, the date and time is at the beginning of the line.
Hi, I am new to unix and I am doing following steps :
1. Ask user to enter date in mm-dd-yyyy format.
2. show the date user entered from step #1 .
3. convert user enter date into YYYY/MM/DD format.
How can I convert any user inputted date into yyyy/mm/dd ?
For example user can input date one of the following 20120121 , 2012-01-21 ,01/21/2012,01/21/2012 etc
But I need to convert any of the date entered by user into yyyy/mm/dd (2012/01/2012). Any suggestion.