Re: Date::Parse and strange dates

2014-07-26 Thread Janek Schleicher
On 25.07.2014 18:54, Chris Knipe wrote: I have the odd (very rare) case where I am given a date in an incorrect format. I already use Date::Parse to convert the dates to a unix timestamp, and it’s working incredibly well. However, on the rare case that I get incorrect dates, Date::Parse does no

Re: Date::Parse and strange dates

2014-07-25 Thread Rob Dixon
On 25/07/2014 17:54, Chris Knipe wrote: Hi All, I have the odd (very rare) case where I am given a date in an incorrect format. I already use Date::Parse to convert the dates to a unix timestamp, and it’s working incredibly well. However, on the rare case that I get incorrect dates, Date::Pars

Re: Date::Parse and strange dates

2014-07-25 Thread Jim Gibson
On Jul 25, 2014, at 9:54 AM, Chris Knipe wrote: > Hi All, > > I have the odd (very rare) case where I am given a date in an incorrect > format. I already use Date::Parse to convert the dates to a unix timestamp, > and it’s working incredibly well. However, on the rare case that I get > inc

Re: Date::Parse and strange dates

2014-07-25 Thread Brian Fraser
On Fri, Jul 25, 2014 at 6:54 PM, Chris Knipe wrote: > Hi All, > > > > I have the odd (very rare) case where I am given a date in an incorrect > format. I already use Date::Parse to convert the dates to a unix timestamp, > and it’s working incredibly well. However, on the rare case that I get > i

Re: Date::Parse and strange dates

2014-07-25 Thread Chris Knipe
On Fri, Jul 25, 2014 at 7:12 PM, Andy Bach wrote: > > On Fri, Jul 25, 2014 at 11:54 AM, Chris Knipe wrote: >> >> Thu, 23 Oct 2008 12:06:48+0400 >> >> >> >> Note the lack of a space between the seconds and the timezone. > > > Well, depending upon the consistency of your one bad case (presuming the

Re: Date::Parse and strange dates

2014-07-25 Thread Andy Bach
On Fri, Jul 25, 2014 at 11:54 AM, Chris Knipe wrote: > Thu, 23 Oct 2008 12:06:48+0400 > > > > Note the lack of a space between the seconds and the timezone. > Well, depending upon the consistency of your one bad case (presuming the date string is in $_ for the moment): if ( s/(\w+, \s+ \d+ \s+ \

Re: Date::Parse and strange dates

2014-07-25 Thread Shawn H Corey
On Fri, 25 Jul 2014 18:54:25 +0200 Chris Knipe wrote: > Is there a simple quick way to fix that by means of a regex? Have you checked Regexp::Common ? It has a whole bunch of date regexps. -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail: beginners-unsubscr...@perl.

Re: Date::Manip DateCalc

2013-03-29 Thread Lawrence Statton
On 03/29/2013 03:01 PM, Grant wrote: I'm getting strange results from a business days calculation with Date::Manip. Everything works as expected if I use a number of days between 1 and 6, but after 6 the resulting date doesn't seem to be based on business days. It is worth noting - the docume

Re: Date::Manip DateCalc

2013-03-29 Thread Grant
>> I'm getting strange results from a business days calculation with >> Date::Manip. Everything works as expected if I use a number of days >> between 1 and 6, but after 6 the resulting date doesn't seem to be >> based on business days. >> >> my $unparsed_date = DateCalc("today","+ 6 days",3); >>

Re: Date::Manip DateCalc

2013-03-29 Thread Owen
> I'm getting strange results from a business days calculation with > Date::Manip. Everything works as expected if I use a number of days > between 1 and 6, but after 6 the resulting date doesn't seem to be > based on business days. > > my $unparsed_date = DateCalc("today","+ 6 days",3); > my $da

Re: Date::Manip question

2012-11-08 Thread Gerhard
On Thu, Nov 08, 2012 at 10:56:00AM +, Marco van Kammen wrote: > my $current_month =(should be Nov) > my $current_mont_num = (should be 11) > my $previous_month = (should be Oct) > my $previous_month_num = (should be 10) There is Time::Piece and

Re: Date::Manip question

2012-11-08 Thread Ken Slater
On Thu, Nov 8, 2012 at 7:42 AM, Marco van Kammen wrote: > Yeah, so something like this: > > #!/usr/bin/perl > > use strict; > use warnings; > > my $previous_month; > my $previous_month_num; > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > > my @months = ( 'JAN', 'F

RE: Date::Manip question

2012-11-08 Thread Marco van Kammen
evious_month_num\n"; seems to work... :-) Thanks all! Marco van Kammen Applicatiebeheerder Mirabeau | Managed ServicesDr. C.J.K. van Aalstweg 8F 301, 1625 NV Hoorn +31(0)20-5950550 - www.mirabeau.nl Please consider the environment before printing this email

Re: Date::Manip question

2012-11-08 Thread David Precious
On Thu, 8 Nov 2012 12:53:31 +0100 Rob Coops wrote: > Something like the below would do perfectly fine... > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > localtime(time); > > my @months = ( 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', > 'SEP', 'OCT', 'NOV', 'DEC' ); >

Re: Date::Manip question

2012-11-08 Thread Rob Coops
On Thu, Nov 8, 2012 at 12:53 PM, Rob Coops wrote: > > On Thu, Nov 8, 2012 at 11:56 AM, Marco van Kammen > wrote: > >> Hi List, >> >> ** ** >> >> For a logrotation and cleanup script I want to fill the following >> variables. >> >> ** ** >> >> my $current_month =(shou

Re: Date::Manip question

2012-11-08 Thread Rob Coops
On Thu, Nov 8, 2012 at 11:56 AM, Marco van Kammen wrote: > Hi List, > > ** ** > > For a logrotation and cleanup script I want to fill the following > variables. > > ** ** > > my $current_month =(should be Nov) > > my $current_mont_num = (should be 11)

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Rob Dixon
On 10/03/2011 23:13, newbie01 perl wrote: On Fri, Mar 11, 2011 at 6:19 AM, Rob Dixon On 10/03/2011 15:33, newbie01 perl wrote: Just want to know what improvement can be done with the code below if any. I am sure a lot of improvement/changes is required. I will be calling this script from a UNI

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Rob Dixon
On 10/03/2011 15:33, newbie01 perl wrote: > Hi all, > > Just want to know what improvement can be done with the code below if any. I > am sure a lot of improvement/changes is required. I will be calling this > script from a UNIX script, i.e.timediff=`timediff.pl $file`, so $file will > be passed t

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Shawn H Corey
On 11-03-10 10:33 AM, newbie01 perl wrote: #!/usr/bin/perl #$today = localtime(); $today_epoch = time(); $today = localtime($today_epoch); my @today = localtime( $today_epoch ); # When in list context, localtime returns an array that can be use with strftime @date_fields = split(" ",$toda

Re: date handle

2011-01-31 Thread John Delacour
At 22:17 -0800 30/01/2011, John W. Krahn wrote: p...@mail.nsbeta.info wrote: $ perl -MTime::Local -le 'print timelocal(0,0,0,1,1,1900)' Cannot handle date (0, 0, 0, 1, 1, 1900) at -e line 1 why Time::Local can't handle the date of 1900? Unix time starts at 1 Jan. 1970 so a time in 1900 is i

Re: date handle

2011-01-30 Thread John W. Krahn
p...@mail.nsbeta.info wrote: $ perl -MTime::Local -le 'print timelocal(0,0,0,1,1,1900)' Cannot handle date (0, 0, 0, 1, 1, 1900) at -e line 1 why Time::Local can't handle the date of 1900? Unix time starts at 1 Jan. 1970 so a time in 1900 is invalid. John -- Any intelligent fool can make th

Re: Date::CalC

2009-03-06 Thread Bobby
That works, thanks a lot for your help and suggestions guys!   Awsome! Have a great weekend all! --- On Fri, 3/6/09, Ryan Masters wrote: From: Ryan Masters Subject: Re: Date::CalC To: cybercruis...@yahoo.com Date: Friday, March 6, 2009, 5:28 PM Bobby, On Fri, Mar 6, 2009 at 5:45 PM, Bobby

Re: Date::CalC

2009-03-06 Thread Owen
On Fri, 6 Mar 2009 14:42:48 -0800 (PST) Bobby wrote: > > Hi, > > Could someone take a look at the code for me below and see if you can > figure out what's wrong with it? I just want to evaluate > $publish_date to see if it's with 21 days of the current date; if so > then set $new_item=" True".

Re: Date::CalC

2009-03-06 Thread Bobby
Correction, $publish_date should equals = "03/02/2009 12:32:03 PM" not 01/02/2009. my $publish_date = "03/02/2009 12:32:03 PM"; --- On Fri, 3/6/09, Bobby wrote: > From: Bobby > Subject: Date::CalC > To: beginners@perl.org > Date: Friday, March 6, 2009, 3:42 PM > Hi, > > Could someone tak

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > Can someone help me on this Impossible. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > Can you explain me this part how it's works? > > (?:\d{2}|\w{3}) > > ?: what this will do? Read perlre (and find out what (?:) means). > And also, the output is like below > > > (C)/tmp/d$ perl 1 > 10-11-81 > 20-NOV-2008 > 05-07-1981 >

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
rg Subject: Re: date format search insdie the files "Sureshkumar M (HCL Financial Services)" schreef: > #/usr/bin/perl > open(DATA,"a1")||die"Unable to open the file"; > while() > { > if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) > { > print $_; > } >

Re: date format search insdie the files

2008-11-29 Thread Dr.Ruud
"Sureshkumar M (HCL Financial Services)" schreef: > #/usr/bin/perl > open(DATA,"a1")||die"Unable to open the file"; > while() > { > if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) > { > print $_; > } > } > close(DATA); > exit 0; #!/usr/bin/perl use strict; use warnings; my $in_name = "data.in";

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
Hi all , Can someone help me on this From: Sureshkumar M (HCL Financial Services) Sent: Saturday, November 29, 2008 4:21 PM To: 'David Schmidt' Cc: beginners@perl.org Subject: RE: date format search insdie the files Hi David,

RE: date format search insdie the files

2008-11-29 Thread Sureshkumar M (HCL Financial Services)
8 05-07-1981 20-03-20009 15-10-2008 (C)/tmp/d$ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Schmidt Sent: Saturday, November 29, 2008 3:12 PM To: Sureshkumar M (HCL Financial Services); beginners@perl.org Subject: Re: date

Re: date format search insdie the files

2008-11-29 Thread David Schmidt
You missed some parentheses #!/usr/bin/perl use strict; use warnings; open(DATA, '<', "data") || die"Unable to open the file"; while() { #if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) { if(/(\d{2}-(\d{2})|(\w{3})-\d{1,4})/) { print; } } close(DATA); exit 0; On S

Re: Date format search in the file

2008-11-22 Thread sftriman
On Nov 22, 6:16 am, [EMAIL PROTECTED] (Dermot) wrote: > 2008/11/22 Sureshkumar M (HCL Financial Services) <[EMAIL PROTECTED]>: > > > > > Hi All, > > Hi > > > > > #!/usr/bin/perl > > # Always use these, particularly when things aren't working as expected. > use strict; > use warnings; > > > open(DAT

Re: Date format search in the file

2008-11-22 Thread John W. Krahn
Dermot wrote: 2008/11/22 Sureshkumar M (HCL Financial Services) <[EMAIL PROTECTED]>: #!/usr/bin/perl # Always use these, particularly when things aren't working as expected. use strict; use warnings; open(DATA,"i")||die "Unable to open the file"; while() { if($_=~/(\d{2})([\W])\1\2\1]/)

Re: Date format search in the file

2008-11-22 Thread John W. Krahn
Sureshkumar M (HCL Financial Services) wrote: Hi All, Hello, I want to find the string which are having the date inside the file. Please help me how do I match it,below is my program and it's not returning anything. #!/usr/bin/perl use warnings; use strict; open(DATA,"i")||die "Unable to

Re: Date format search in the file

2008-11-22 Thread Dermot
2008/11/22 Sureshkumar M (HCL Financial Services) <[EMAIL PROTECTED]>: > > Hi All, Hi > > #!/usr/bin/perl # Always use these, particularly when things aren't working as expected. use strict; use warnings; > open(DATA,"i")||die "Unable to open the file"; > > while() > > { > > if($_=~/(\d{2})([\W

Re: date info

2008-08-07 Thread Jeff Pang
Urvish Jain 写道: > Hi all, > > I'm new to community as well as perl programming language. I have a perl > script with me and I need to execute it for creating rr database (rrd), Has > anybody worked on this before. Please help! > Hello, Welcome to this list. As a perl programmer, you may lear

RE: date info

2008-08-07 Thread Urvish Jain
ng Cc: beginners@perl.org Subject: Re: date info michael wang 写道: > Hi, > > if I have something like 20080503, how can I get the date a year ago, > such as 20070503 in perl? > you may extract the exact date from the original string (ie, use a regex), then convert it to any

Re: date info

2008-08-06 Thread Chris Charley
- Original Message - From: ""michael wang"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Wednesday, August 06, 2008 9:00 AM Subject: date info Hi, if I have something like 20080503, how can I get the date a year ago, such as 20070503 in perl? Thanks, michael

Re: date info

2008-08-06 Thread Rob Dixon
michael wang wrote: > > if I have something like 20080503, how can I get the date a year ago, > such as 20070503 in perl? If you simply want to subtract one from the first four-digit field found in your string, then you can write $str =~ s/(\d{4})/$1-1/e; HTH, Rob -- To unsubscrib

Re: date info

2008-08-06 Thread michael wang
On 8/6/08, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Wed, 2008-08-06 at 08:00 -0500, michael wang wrote: > > Hi, > > > > if I have something like 20080503, how can I get the date a year ago, > > such as 20070503 in perl? > > > > Thanks, > > > > michael > > my $str = '20080503

Re: date info

2008-08-06 Thread Mr. Shawn H. Corey
On Wed, 2008-08-06 at 08:00 -0500, michael wang wrote: > Hi, > > if I have something like 20080503, how can I get the date a year ago, > such as 20070503 in perl? > > Thanks, > > michael my $str = '20080503'; $str =~ s/(.*)(\d\d\d\d)(\d\d\d\d)$/$1.($2-1).$3/e print "$str\n"; --

Re: date info

2008-08-06 Thread Jeff Pang
michael wang 写道: > Hi, > > if I have something like 20080503, how can I get the date a year ago, > such as 20070503 in perl? > you may extract the exact date from the original string (ie, use a regex), then convert it to any date form you wanted (use POSIX::strftime or something like th

Re: Date::Manip

2008-05-12 Thread reader
Rob Dixon <[EMAIL PROTECTED]> writes: >> What is the right syntax? > > print $date = ParseDate("epoch 1210628919") . "\n"; Egad, and there is a big NOTE in perldoc Date::Manip about that very thing... thanks for you patience For anyone finding these posts with a search: (From perldoc Date::M

Re: Date::Manip

2008-05-12 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > Can soneone show me how to convert unix time to something else using > Date:: Manip? > > AFter looking at the Docs in perldoc Date::Manip I thought maybe (from > the examples) something like script below would work. The first two > (now commented) worked as expected bu

Re: Date::manip query

2007-12-19 Thread Gunnar Hjalmarsson
pauld wrote: Gunnar Hjalmarsson wrote: pauld wrote: im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, Why are you doing that? C:\home>type test.pl @dates = ( '2007:08:02 12:23', '2007:10:21 04:40', '2007:06:05 16:08', '2007:09:11 22

Re: Date::manip query

2007-12-19 Thread Tom Phoenix
On 12/19/07, pauld <[EMAIL PROTECTED]> wrote: > im sorting it on a key of the hash > my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } > @daylist; > generates a > Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) > at ./518573 Have you tried using a string comp

Re: Date::manip query

2007-12-19 Thread pauld
im sorting it on a key of the hash my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } @daylist; generates a Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) at ./518573 error my @daylistsorted = sort { $$a{'START'} <=> $$b{'START'} } @daylist; works -- To u

Re: Date::manip query

2007-12-18 Thread Gunnar Hjalmarsson
pauld wrote: im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, Why are you doing that? C:\home>type test.pl @dates = ( '2007:08:02 12:23', '2007:10:21 04:40', '2007:06:05 16:08', '2007:09:11 22:20', ); print "$_\n" for sort @dates; C

Re: Date::manip query

2007-12-18 Thread pauld
the END_DS field is the date field that I want - but as I couldnt get it back from the seconds since epoch field I included it. IMHO it would be tideir to just use the (numerical) date-seconds and convert it back as necessary . i used the Date::Manip function Date_SecsSince1970($m,$d,$y,$h,$mn,$

Re: Date::manip query

2007-12-18 Thread Rob Dixon
pauld wrote: > im importing data from an excel spreadsheet into an array of hashes. the date is initially converted using Date::Format::Excel. for this bit {START} = unix start time .{START_DS} = string that I use to convert to unixtime with my $var=0;my [EMAIL PROTECTED]; while ($var<$va_leng

Re: Date::manip query

2007-12-17 Thread Chas. Owens
On Dec 18, 2007 1:05 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: snip > > printf ( > > "%s from $s to %s duration %s %s\n", snip You missed the usage of $s instead of %s. I always get bitten by that. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Date::manip query

2007-12-17 Thread John W . Krahn
On Monday 17 December 2007 15:40, [EMAIL PROTECTED] wrote: > > On Dec 17, 3:22 am, [EMAIL PROTECTED] (Pauld) wrote: > > > > my $var=0;my [EMAIL PROTECTED]; > > while ($var<$va_length) > > { > > print "${$daylistsorted[$var]}{TH} "; > > print 'from '; > > print ${$daylistsorted[$var]}{START}; > >

Re: Date::manip query

2007-12-17 Thread davidfilmer
On Dec 17, 3:22 am, [EMAIL PROTECTED] (Pauld) wrote: > my $var=0;my [EMAIL PROTECTED]; > while ($var<$va_length) > { > print "${$daylistsorted[$var]}{TH} "; > print 'from '; > print ${$daylistsorted[$var]}{START}; > print ' to '.${$daylistsorted[$var]}{END_DS}; > print " duration ";print int

Re: Date::manip query

2007-12-17 Thread pauld
im importing data from an excel spreadsheet into an array of hashes. the date is initially converted using Date::Format::Excel. for this bit {START} = unix start time .{START_DS} = string that I use to convert to unixtime with my $var=0;my [EMAIL PROTECTED]; while ($var<$va_length) { print "${$d

Re: Date::manip query

2007-12-16 Thread Rob Dixon
pauld wrote: > im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, which it does . but I cant see how to get the number back into a human -readable format print scalar localtime($var{STARTTIME}); prints the long string . is there a better way to get ju

Re: Date::manip query

2007-12-16 Thread John W . Krahn
On Sunday 16 December 2007 04:31, pauld wrote: > > im using Date::Manip to convert dates and times eg 2007:08:02 12:23 > to allow me to sort them, which it does . > but I cant see how to get the number back into a human -readable > format Use the UnixDate() function that comes with Date::Manip.

Re: Date and Time and Function calls

2007-11-25 Thread Martin Barth
Hi Andrew, I would suggest http://search.cpan.org/~tjenness/File-Temp-0.19/Temp.pm HTH Martin On Sat, 24 Nov 2007 08:44:18 -0800 AndrewMcHorney <[EMAIL PROTECTED]> wrote: > Hello > > I am looking for a perl function or functions that will give me the > date and time. I am going to use the r

Re: Date and Time and Function calls

2007-11-25 Thread Dr.Ruud
rahed schreef: > AndrewMcHorney: >> I am looking for a perl function or functions that will give me the >> date and time. I am going to use the results to create a unique file >> name. > > There are many posibilities depending on uniqueness, > this is quite similar: > > $randnum = 1000 + int r

Re: Date and Time and Function calls

2007-11-25 Thread rahed
AndrewMcHorney <[EMAIL PROTECTED]> writes: > Hello > > I am looking for a perl function or functions that will give me the > date and time. I am going to use the results to create a unique file > name. There are many posibilities depending on uniqueness, this is quite similar: $randnum = 1000

Re: Date and Time and Function calls

2007-11-25 Thread Tom Phoenix
On 11/24/07, AndrewMcHorney <[EMAIL PROTECTED]> wrote: > I am looking for a perl function or functions that will give me the > date and time. Are you looking in the perlfunc manpage? Type 'perldoc perlfunc' at a prompt (or into your favorite search engine) to get started. > I am going to use t

Re: Date and Time and Function calls

2007-11-25 Thread yitzle
time will give you the number of seconds since the epoch. This is good so long as you don't expect to create two files in one second. http://perldoc.perl.org/functions/time.html "For measuring time in better granularity than one second, you may use either the Time::HiRes module (from CPAN, and sta

Re: Date addition-reg

2007-11-12 Thread jeevs
On Oct 23, 12:15 pm, [EMAIL PROTECTED] (Jeevs) wrote: > On Oct 23, 2:19 pm, [EMAIL PROTECTED] wrote: > > > > > Hi > > > Thaks for ur valuable info.. > > > my code is > > > my $total_nights="3"; > > $total_nights = "0".$total_nights if ((!($total_nights =~ > > /^0/)) && ($total_nights < 10))

Re: Date addition-reg

2007-10-23 Thread jeevs
On Oct 23, 2:19 pm, [EMAIL PROTECTED] wrote: > Hi > > Thaks for ur valuable info.. > > my code is > > my $total_nights="3"; > $total_nights = "0".$total_nights if ((!($total_nights =~ > /^0/)) && ($total_nights < 10)); > my $start_date="2008-03-24"; > my ($year,$mon,$day) = split/-/,$start_

Re: Date addition-reg

2007-10-23 Thread Jeff Pang
Please don't open a new topic when you repeat the same question. >$day=($day+$total_nights); I've said clearly,you can't do date oprations by this way. See my before message that answered your question fully. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: date addition-reg

2007-10-22 Thread Aruna Goke
Jeff Pang wrote: On 10/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: HI I need to get the $to as 18-10-2007 But it throws as 18.can u give the suggestion to get the same format? Thanks #!/usr/perl/bin $from="15-10-2007"; $to=$from+"3"; print "$from,\n"; print "$to"; It looks

Re: date addition-reg

2007-10-22 Thread Jeff Pang
On 10/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > HI > I need to get the $to as 18-10-2007 > But it throws as 18.can u give the suggestion to get the > same format? > Thanks > > #!/usr/perl/bin > $from="15-10-2007"; > $to=$from+"3"; > print "$from,\n"; > print "$to"; > It lo

Re: Date and time

2007-01-22 Thread M. Lewis
Rob Dixon wrote: M. Lewis wrote: > > Given the following code, if I were to want $day, $month, $hour, $minute > & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only > option to use printf? Or is there a better way. > > What I'm searching for here is the *correct* method

Re: Date and time

2007-01-21 Thread Rob Dixon
M. Lewis wrote: > > Given the following code, if I were to want $day, $month, $hour, $minute > & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only > option to use printf? Or is there a better way. > > What I'm searching for here is the *correct* method to get $day, $month, > et

Re: Date and time

2007-01-21 Thread Dr.Ruud
"M. Lewis" schreef: > if I were to want $day, $month, $hour, > $minute & $sec to have a leading zero (ie 01 for Jan rather than 1), > is my only option to use printf? Or is there a better way. > > What I'm searching for here is the *correct* method to get $day, > $month, etc for uses like naming

Re: Date and time

2007-01-21 Thread Goksie
M. Lewis wrote: > > Given the following code, if I were to want $day, $month, $hour, > $minute & $sec to have a leading zero (ie 01 for Jan rather than 1), > is my only option to use printf? Or is there a better way. > > What I'm searching for here is the *correct* method to get $day, > $month, etc

Re: Date and time

2007-01-21 Thread Owen
On Sun, 21 Jan 2007 02:17:08 -0500 "M. Lewis" <[EMAIL PROTECTED]> wrote: > > Given the following code, if I were to want $day, $month, $hour, $minute > & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only > option to use printf? Or is there a better way. Look at sprintf pe

Re: Date and time

2007-01-21 Thread John W. Krahn
M. Lewis wrote: > > Given the following code, if I were to want $day, $month, $hour, $minute > & $sec to have a leading zero (ie 01 for Jan rather than 1), is my only > option to use printf? Or is there a better way. > > What I'm searching for here is the *correct* method to get $day, $month, > e

Re: date and file comparison

2006-11-03 Thread Arnaldo Guzman
On Fri, 2006-11-03 at 08:08 -0600, Tim Wolak wrote: > Morning all, > > I need to compare the current date with that of a file, if the file is > older than the current date remove it and replace it with a new one from > new data. Below I have the code set for getting the date but can't come > up

Re: date and file comparison

2006-11-03 Thread Dr.Ruud
"Tim Wolak" schreef: > I need to compare the current date with that of a file, if the file is > older than the current date remove it and replace it with a new one > from new data. Below I have the code set for getting the date but > can't come up with an easy way to compare it against the file d

RE: Date and Time Functions

2006-09-22 Thread Lee Goddard
Xavier Mas i Ramón [mailto:[EMAIL PROTECTED] : > A Dijous 21 Setembre 2006 01:38, [EMAIL PROTECTED] va escriure: > > > I am looking for some simple perl functions that will return the > > current date and time in string format. The purpose is to create a > > file with part of the name being the d

Re: Date and Time Functions

2006-09-21 Thread Xavier Mas i Ramón
A Dijous 21 Setembre 2006 01:38, [EMAIL PROTECTED] va escriure: > Hello > > I am looking for some simple perl functions that will return the current > date and time in string format. The purpose is to create a file with part > of the name being the date and time. > > Thanks, > Andrew sytem "date"

Re: Date and Time Functions

2006-09-20 Thread Owen Cook
On Wed, 20 Sep 2006 [EMAIL PROTECTED] wrote: > Hello > > I am looking for some simple perl functions that will return the current date > and time in string format. The purpose is to create a file with part of the > name being the date and time. I use something like this

Re: Date and Time Functions

2006-09-20 Thread Jeff Pang
Hi, Many of the functions exist on CPAN.One of them is 'strftime' which is coming from POSIX. use POSIX 'strftime'; print strftime "%Y-%m-%d",localtime; __END__ You'll get: 2006-09-21 As the same effect as the unix command of 'date +%Y-%m-%d' 's output. Hope it helps. -Original Message-

RE: Date Time

2006-07-12 Thread Timothy Johnson
It looks like part of your message got munged by one of our mail clients, but here's a code snippet that should give you an idea of how you can proceed: ## use strict; use warnings; $| = 1; my $string = '200607081000@@01510'; #Check to make sure the regex matched, then proceed.

Re: Date Time

2006-07-12 Thread John W. Krahn
Semiyi.Abiola wrote: > Hi, Hello, > I got a file with this line: > > > 200607081000@@01510 > > It means Datetime@@Values > > I'm trying to insert this in Mysql with fields terminated by `@@`'; > > It's works fine but i got the wrong Datetime. > How kann i change 200607081000

Re: date & time from server problem/question

2006-05-17 Thread John W. Krahn
Graeme McLaren wrote: > Hi there, I decided that it would be a good idea to 'touch' the file > immediately after creating it and changing the modified date to the > current date, however its just not working for me. > > > change file permissions and 'touch' the file: > > system("chmod 777 "filep

Re: date & time from server problem/question

2006-05-17 Thread Graeme McLaren
nd Sub From: "Graeme McLaren" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] CC: beginners@perl.org Subject: Re: date & time from server problem/question Date: Wed, 17 May 2006 09:30:59 +0100 MIME-Version: 1.0 X-Originating-IP: [62.254.183.162] X-Originating-Email: [EM

Re: date & time from server problem/question

2006-05-17 Thread Graeme McLaren
or Resume drink If Pint.empty = True Then Pint.refill Else Pint.drink End if stomach.add Pint MsgBox " I've had " & stomach.count & " Pints" MsgBox "VERY DRUNK" End Sub From: "Tom Phoenix"

RE: date & time from server problem/question

2006-05-11 Thread Timothy Johnson
If the server is a Windows server you can use the Win32::FileTime module to get the info you need. -Original Message- From: Graeme McLaren [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 9:55 AM To: beginners@perl.org Subject: date & time from server problem/question Hi all, I

Re: date & time from server problem/question

2006-05-11 Thread Tom Phoenix
On 5/11/06, Graeme McLaren <[EMAIL PROTECTED]> wrote: Hi all, I'm trying to get the date & time a file was created on the server, I RTFM and I found: 10 ctimeinode change time (NOT creation time!) in seconds since the epoch It looks as if you've found the correct FM. There are three times

Re: date and time in perl

2006-04-10 Thread nishanth ev
Hello, Use this code according to your requirement. #!/usr/bin/perl $no=`date`; print $no; Regards Nish __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAI

Re: date and time in perl

2006-04-10 Thread Dr.Ruud
Irfan J Sayed schreef: > Can you tell me exact command / syntax [...] > so that i can store date,time in some variable. See: perldoc -f localtime http://perlmeme.org/faqs/datetime/ -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: date and time in perl

2006-04-10 Thread Irfan J Sayed
Thanks Jelf Regards Irfan Sayed Jeff Pang <[EMAIL PROTECTED]> 04/10/2006 06:11 PM Please respond to Jeff Pang <[EMAIL PROTECTED]> To beginners@perl.org cc Subject Re: date and time in perl >Hi, > >Can you tell me exact command / syntax as i struggled lot bu

Re: date and time in perl

2006-04-10 Thread Jeff Pang
>Hi, > >Can you tell me exact command / syntax as i struggled lot but didn't >succeed so that i can store date,time in some variable. > Hi,you can use the 'strftime' which is coming from POSIX to get your time format similar to Unix shell command. for example,you could write: use POSIX qw(str

Re: date and time in perl

2006-04-10 Thread Irfan J Sayed
cc beginners@perl.org Subject Re: date and time in perl On 4/1/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > Hi All, > > How to get date and time in perl ? is there any function for that ? > > Regards > Irfan Sayed localtime() returns the current time in your timezone

Re: date and time in perl

2006-04-10 Thread Chas Owens
On 4/1/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > Hi All, > > How to get date and time in perl ? is there any function for that ? > > Regards > Irfan Sayed localtime() returns the current time in your timezone. When called in scalar context it returns a string representation of the date and t

RE: Date difference.

2006-04-06 Thread Mr. Shawn H. Corey
On Thu, 2006-06-04 at 11:03 -0700, Timothy Johnson wrote: > I saw that someone already recommended Date::Calc, but I'll make another > suggestion: Time::Local. It's a much more lightweight module, and it > depends on your ultimate needs, but it's a good one to be familiar with. > It takes text da

RE: Date difference.

2006-04-06 Thread Timothy Johnson
I saw that someone already recommended Date::Calc, but I'll make another suggestion: Time::Local. It's a much more lightweight module, and it depends on your ultimate needs, but it's a good one to be familiar with. It takes text dates and converts them to Perl time() format. -Original Mess

RE: Date difference.

2006-04-06 Thread Mr. Shawn H. Corey
On Thu, 2006-06-04 at 09:28 -0400, Brian Volk wrote: > > Excellent summary of most methods at > > http://perlmeme.org/faqs/datetime/comparing_dates.html. > > > > Regards > > > > James Turnbull > > Hi All, > > I'm running through the example of Date::Calc on the site listed above. > When I plug

Re: Date difference.

2006-04-06 Thread Flemming Greve Skovengaard
Brian Volk wrote: Excellent summary of most methods at http://perlmeme.org/faqs/datetime/comparing_dates.html. Regards James Turnbull Hi All, I'm running through the example of Date::Calc on the site listed above. When I plug in today's date as my birthday... it returns: I am -31 days old.

RE: Date difference.

2006-04-06 Thread Brian Volk
> Excellent summary of most methods at > http://perlmeme.org/faqs/datetime/comparing_dates.html. > > Regards > > James Turnbull Hi All, I'm running through the example of Date::Calc on the site listed above. When I plug in today's date as my birthday... it returns: I am -31 days old. I wou

Re: Date difference.

2006-04-05 Thread hridyesh pant
Thanks Thomas i got it. Regards Hridyesh Thomas Bätzler wrote: Hi, i have two date string reading from the log file like below. $date1="Mon Mar 27 02:45:15 2006"; $date2="Wed Apr 5 23:20:46 2006"; $Number_of_Days = $date1-$date2; i want to get number of days between these two dates. Can

Re: Date difference.

2006-04-05 Thread James Turnbull
hridyesh pant wrote: Hi, i have two date string reading from the log file like below. $date1="Mon Mar 27 02:45:15 2006"; $date2="Wed Apr 5 23:20:46 2006"; $Number_of_Days = $date1-$date2; i want to get number of days between these two dates. Can someone help me. Excellent summary of most met

Re: Date difference.

2006-04-05 Thread Owen Cook
On Thu, 6 Apr 2006, hridyesh pant wrote: > Hi, > i have two date string reading from the log file like below. > $date1="Mon Mar 27 02:45:15 2006"; > $date2="Wed Apr 5 23:20:46 2006"; > > $Number_of_Days = $date1-$date2; > i want to get number of days between these two dates. > Can someone help

RE: Date difference.

2006-04-05 Thread Thomas Bätzler
Hi, > i have two date string reading from the log file like below. > $date1="Mon Mar 27 02:45:15 2006"; > $date2="Wed Apr 5 23:20:46 2006"; > > $Number_of_Days = $date1-$date2; > i want to get number of days between these two dates. > Can someone help me. Have a look at Steffen Beyer's excelle

  1   2   3   >