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:
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.
hey guys.
the following line is a line taken from apache's access_log
Code:
10.10.10.10 - jdoe [28/Jun/2012:14:24:15 +0000] "GET /images/down.gif HTTP/1.1" 304
I'm concerned about the field that has the date and time in it.
if assuming the delimiter in the file is a space, then the fourth field will always have the date and time in it.
however, it is my understanding that the d
I have a file cccam.cfg
which contains line like that
Code:
F: user pass 1 0 0 {0 0 1} # 24-02-2013
F: user1 pass1 1 0 0 {0 0 1} # 01-11-2012
I want a script that adds the symbol # before the line that the date has expired
like this
Code:
# F: user1 pass1 1 0 0 {0 0 1}# 01-11-2012
but in the same file cccam.cfg
and thank you
---------- Post updated at 04:55 PM ---------- Previous upd
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 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.
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 Date format is like as "MM-dd-yyyy hh:mm" its not current date ,I have to send this date
to server but before send it need to change this date to GMT format but when I change by following code:
private String[] DateConvertor(String datevalue)
{
String date_value[] = null;
String strGMTFormat = null;
SimpleDateFormat objFormat,objFormat1;
How can I allow users to change the date and time in a script? Say the user1 wil login and he will be inputting the desired date (example format below). I will need this script so the user can login and change the date anytime during the day. I will not allow him to use any command except the date change so Im planning to incorporate a menu script on it. Pls help.