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.
I have an SQL fact table which is used for looking up a date and returning another date.
The table schema is as follows:
TABLE date_lookup
(
pk_date DATE,
plus1_months DATE,
plus2_months DATE,
plus3_months DATE
);
UNIQUE INDEX on date_lookup(pk_date);
I have a load file (pipe delimited) containing dates from 01-28-2012 to 03-31-2014.
The following is an example of the load file:
01-2
Ok...this is really bumming me out because it seems like it should be simple, but for some reason, I just can't get it...I've also googled and searched these forums, and haven't found exactly what I'm looking for...
I have a date in mm/dd/yyyy format in a variable...I need to extract the abbreviated name of the day of week from that variable...so I start with this:
10/18/2012
and end up with thi
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?
I have a CSV file with date time formatted like this:
8/2/2012 1:34:01 PM
I need to find all the occurrences (probably regex) of such date and convert it (in file) to mysql default datetime format (2012-08-02 13:34:01).
I found that
date --date="8/2/2012 1:34:01 PM" +"%F %T"
is working properly and I'm getting correct result.
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?
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).
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
Id like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk.
I tried
This is how each line of the file looks like, different date and time in this format
Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th
Through some help here, I was able to add delimiter and make it the way I want
Sun Aug 19 08:33:45 EDT 20