10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am writing a ksh shell script to check the last month end date whether it is falling in last 10 week day date, I am not sure How to use "Mr. Perderabo's date calculator", Could you Please let me know how to use to get my requirement, I tried my own script but duplicate week day and... (5 Replies)
Discussion started by: karthikram
2. Shell Programming and Scripting
i have a file something like this :
and i want (end - start) total run time in below format:
00:15:00 (4 Replies)
Discussion started by: Acme
3. Shell Programming and Scripting
Totally newbie in scripting. And need helps in preparing a script to help me to do file moving, renaming and even delete.
I have 2 directories.
a) I will be getting new text files (e.g NewFile23052013.txt) created in the directory #1 every day... (1 Reply)
Discussion started by: quickerz
4. Shell Programming and Scripting
I was wondering the best way about finding files that were created today and copy them to a directory (grep ?). There can be multiple files for todays date or none. I am looking to copy all of the .lis files for todays date. I may need to modify the filename to include todays date but for the... (4 Replies)
Discussion started by: smkremer
5. Shell Programming and Scripting
I have a file with a field containing the following:
"7/3/2009 7:07:12 PM","xxxx"
I need to be able to split this field up into two into a different format with the time being converted into 24 hour:
so that i can get the following:
"20090307","19:07:12","xxxx" (8 Replies)
Discussion started by: Pablo_beezo
6. Shell Programming and Scripting
if I have a string delimited by commas how can I put each character on a new line followed by a carriage return, and output this to a filee.g
thanks you (3 Replies)
Discussion started by: Wahmed9
7. Shell Programming and Scripting
I need to write two shell scripts for an rsync backup solution. The first script will copy all backed up files into a folder named after the original folder, plus a date stamp (so e.g. if the original folder name is 'foo' and is backed up on the 10th of September, then the backup folder will be... (0 Replies)
Discussion started by: LambdaCalculus
8. Shell Programming and Scripting
I'm comparing my file date with the system date and if both the dates are equal I'm doing some operation. I use two variables for these two dates. I use the following command in my query. if ....
But here the current date $cd shows 01 and filedate $fdate shows 1. The file is created on 1 of ... (6 Replies)
Discussion started by: pstanand
9. Shell Programming and Scripting
I have a set of files ina diectory which has the name in format "WWW-YYYYmmDD"
like, WWW-20070226. for 26th FEB 2007.
Now I need to write a shell script which should move the files to directory named "old" in the same directory if date attached to file is 90 days prior to today's... (1 Reply)
Discussion started by: jnanesh.b
10. Shell Programming and Scripting
I have the following script (from this forum) to calculate yesterdays date.
However the format of the date that is output is yyyymd if the resultant date is single digit or the resultant month is a single digit month ( 01 - 09 ). How can I get the output to show the date in the following... (3 Replies)
Discussion started by: geomonap
Date::Parse(3) User Contributed Perl Documentation Date::Parse(3)
Date::Parse - Parse date strings into time values
$time = str2time($date);
($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);
"Date::Parse" provides two routines for parsing date strings into time values.
str2time(DATE [, ZONE])
"str2time" parses "DATE" and returns a unix time value, or undef upon failure. "ZONE", if given, specifies the timezone to assume when
parsing if the date string does not specify a timezome.
strptime(DATE [, ZONE])
"strptime" takes the same arguments as str2time but returns an array of values "($ss,$mm,$hh,$day,$month,$year,$zone)". Elements are
only defined if they could be extracted from the date string. The $zone element is the timezone offset in seconds from GMT. An empty
array is returned upon failure.
Date::Parse is capable of parsing dates in several languages, these are English, French, German and Italian. Changing the language is done
via a static method call, for example
will cause Date::Parse to attempt to parse any subsequent dates in German.
This is only a first pass, I am considering changing this to be
$lang = Date::Language->new('German');
$lang->str2time("25 Jun 1996 21:09:55 +0100");
I am open to suggestions on this.
Below is a sample list of dates that are known to be parsable with Date::Parse
Wed, 16 Jun 94 07:29:35 CST Comma and day name are optional
Thu, 13 Oct 94 10:13:13 -0700
Wed, 9 Nov 1994 09:50:32 -0500 (EST) Text in ()'s will be ignored.
21 dec 17:05 Will be parsed in the current time zone
1999 10:02:18 "GMT"
16 Nov 94 22:28:20 PST
When both the month and the date are specified in the date as numbers they are always parsed assuming that the month number comes before
the date. This is the usual format used in American dates.
The reason why it is like this and not dynamic is that it must be deterministic. Several people have suggested using the current locale,
but this will not work as the date being parsed may not be in the format of the current locale.
My plans to address this, which will be in a future release, is to allow the programmer to state what order they want these values parsed
Graham Barr <firstname.lastname@example.org>
Copyright (c) 1995 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
perl v5.8.0 2002-06-06 Date::Parse(3)