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

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

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

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

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.

Date::Parse and strange dates

2014-07-25 Thread Chris Knipe
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::Parse does not like them either and e

Re: converting dates to epoch seconds and back

2013-01-18 Thread John W. Krahn
Bill Stephenson wrote: When converting DMYHMS to Epoch Seconds and back I get cheated out of a day. Why? Bill -- #!/usr/bin/perl use strict; use warnings; use Time::Local; my ($time, $month, $day, $year, $seconds, $minutes, $hours, $wday, $yday, $isdst); my $start_date = '11/30/2012'; pr

Re: converting dates to epoch seconds and back

2013-01-18 Thread Dominik Danter
The output depends on the timezone that you have set on your machine. You can toy around and try different ones with $ENV{TZ} = 'Europe/Vienna'; or $ENV{TZ} = 'America/Los_Angeles'; If you don't want to depend on the timezone use gmtime instead of localtime. Bill Stephenson hat am 18. Januar 201

RE: converting dates to epoch seconds and back

2013-01-18 Thread twlewis
year+1900); print "$month/$day/$year \n"; -Original Message- From: "Bill Stephenson" Sent: Friday, January 18, 2013 3:13pm To: "Perl Beginners" Subject: converting dates to epoch seconds and back When converting DMYHMS to Epoch Seconds and back I get cheated out of

converting dates to epoch seconds and back

2013-01-18 Thread Bill Stephenson
When converting DMYHMS to Epoch Seconds and back I get cheated out of a day. Why? Bill -- #!/usr/bin/perl use strict; use warnings; use Time::Local; my ($time, $month, $day, $year, $seconds, $minutes, $hours, $wday, $yday, $isdst); my $start_date = '11/30/2012'; print "$start_date \n"; ($

Problems in dates and time additions by one minute.

2011-12-18 Thread Raheel Hassan
e you assuming the current year for all dates? I need to read these files from from the first date(Dec 5 09:02:01) till > the last date (Dec 17 17:34:02) in the file. Then i have to search a word > between the time difference of one minute and i have to count that how many > times tha

RE: Problems in dates and time additions by one minute.

2011-12-18 Thread Lou Pereira
How do I unsubscribe from this list?? I tried a few times without success! -Original Message- From: Raheel Hassan [mailto:raheel.has...@gmail.com] Sent: Saturday, December 17, 2011 5:58 PM To: beginners@perl.org Subject: Problems in dates and time additions by one minute. Hi, I

Re: Problems in dates and time additions by one minute.

2011-12-17 Thread John W. Krahn
Raheel Hassan wrote: Hi, Hello, I have 3 files (these are the log files of the system). These files have date formate like this (Dec 5 09:02:01). Most date fields also have the year but your's doesn't appear to. Are you assuming the current year for all dates? I need to

Problems in dates and time additions by one minute.

2011-12-17 Thread Raheel Hassan
handle these dates. I have read about the Time::Local but that did not solve my problem. I will be very thankful for any help. Raheel

Re: Arrays, Dates, Indexing and Initialisation

2009-09-29 Thread Dr.Ruud
of bad design. b. Is it possible, to have dates as index? I am trying to parse and process data corresponding to a list of "trades" I have made(financial trades) and want to see, how my portfolio varies with time. So is it possible to do in such a way? Just format them as a string

Re: Arrays, Dates, Indexing and Initialisation

2009-09-29 Thread Dr.Ruud
r...@i.frys.com wrote: Soham Das wrote: int a[125]; for(i=0;i<125;i++) a[i]=0; my @array; $array[$_] = 0 for 0..125; s/125/124/ -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: be

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
Soham Das wrote: My agenda actually is two pronged. I have read Beginning Perl and a bit of Intermediate Perl, though was able to solve individual problems, but I was not sure,if I can code myself out of a wet paperbag. So I thought, lets chuck theory. Its better to get hands dirty with some r

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Soham - Original Message From: Shawn H Corey To: Uri Guttman Cc: Soham Das ; beginners@perl.org Sent: Monday, 28 September, 2009 10:45:33 PM Subject: Re: Arrays, Dates, Indexing and Initialisation Uri Guttman wrote: > only for ++/-- and +=/-= will that work with no warnings. if he uses an > un

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
Uri Guttman wrote: only for ++/-- and +=/-= will that work with no warnings. if he uses an undef value in another arithmetic expression it will warn. Also, undef values work in if/unless and while/until conditions. Usually when you see indexes used with arrays, it is because the programmer do

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> Soham Das wrote: >> a.. How do I initialise an array of a definite size with zero. Say the C equivalent of such a statement will be: >> int a[125]; >> for(i=0;i<125;i++)a[i]=0; SHC> Not needed. Perl assume zero if a non-ex

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Uri Guttman
> "JK" == Jenda Krynicky writes: >> > >> > a.. How do I initialise an array of a definite size with >> > zero. Say the C equivalent of such a statement will be: >> my @array; >> $array[$_] = 0 for 0..125; JK> my @array = (0) x 126; and a question for the OP is why do you need t

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Thanks Shawn, yes hashes I guess will be the way to go forward. Soham - Original Message From: Shawn H Corey To: Soham Das Cc: beginners@perl.org Sent: Monday, 28 September, 2009 9:50:18 PM Subject: Re: Arrays, Dates, Indexing and Initialisation Soham Das wrote: > a.. How d

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
Wow! sweet! Hi Jenda, thanks for the help. And I guess, for the dates problem I have to use hashes, eh? Soham - Original Message From: Jenda Krynicky To: beginners@perl.org Sent: Monday, 28 September, 2009 9:50:40 PM Subject: Re: Arrays, Dates, Indexing and Initialisation Date

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Shawn H Corey
is used in an arithmetic expression. perl -e '$a[$_] += int(rand(10)) for 0..10;print"@a\n"' b. Is it possible, to have dates as index? I am trying to parse and process data corresponding to a list of "trades" I have made(financial trades) and want to see, how my

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Jenda Krynicky
Date sent: Mon, 28 Sep 2009 09:11:02 -0700 Subject:Re: Arrays, Dates, Indexing and Initialisation From: r...@i.frys.com To: "Soham Das" Copies to: beginners@perl.org > Soham Das wrote: > > Hello Al

Re: Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread rkb
for(i=0;i<125;i++) >a[i]=0; > my @array; $array[$_] = 0 for 0..125; > b. Is it possible, to have dates as index? I am trying to > parse and process data corresponding to a list of "trades" > I have made(financial trades) and want to see, how my > portfolio

Arrays, Dates, Indexing and Initialisation

2009-09-28 Thread Soham Das
it possible, to have dates as index? I am trying to parse and process data corresponding to a list of "trades" I have made(financial trades) and want to see, how my portfolio varies with time. So is it possible to do in such a way? Hoping for some insights, Soham P.S: Would like to

Re: script to compare dates

2009-08-18 Thread Steve Bertrand
Mihir Kamdar wrote: > i am sorry Steve...actually I miswrote DateTime instead of DateManip... > > i saw your code using DateTime but I before I posted this, I was trying > using DateManip...but while testing the code, I found out that DateManip > is not installed... > > i tried executing your c

Re: script to compare dates

2009-08-18 Thread Mihir Kamdar
=> 2009, >month => 3, >day => 31 >); > > ># turn the extracted date string into a DateTime object > >my $date_formatter >= new DateTime::Format::Strptime( pattern =

Re: script to compare dates

2009-08-18 Thread Steve Bertrand
); # turn the extracted date string into a DateTime object my $date_formatter = new DateTime::Format::Strptime( pattern => '%d-%b-%y' ); my $voucher_date = $date_formatter->parse_datetime($date_string); # compare the DateTime compiled dates

Re: script to compare dates

2009-08-18 Thread Mihir Kamdar
>>> DateTime?? >>> >> >> As always, TIMTOWTDI, but I have to maintain a lot of legacy code, where >> the original author (including myself) would rewrite date routines >> (differently) in each subroutine that needed to parse/manipulate dates. >>

RE: script to compare dates

2009-08-18 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Mihir Kamdar [mailto:kamdarmihi...@gmail.com] > Sent: Tuesday, August 18, 2009 08:55 > To: Steve Bertrand > Cc: beginners > Subject: Re: script to compare dates > > I dont have Datetime module installed. Is there a way

Re: script to compare dates

2009-08-18 Thread Shawn H. Corey
that needed to parse/manipulate dates. I would highly advise that you get DateTime installed at any cost. It is consistent, extremely flexible, and very well maintained and documented. There is also a spectacular number of different formatting modules as well that make all tasks involving dates

Re: script to compare dates

2009-08-18 Thread Steve Bertrand
parse/manipulate dates. I would highly advise that you get DateTime installed at any cost. It is consistent, extremely flexible, and very well maintained and documented. There is also a spectacular number of different formatting modules as well that make all tasks involving dates easy and enj

Re: script to compare dates

2009-08-18 Thread Telemachus
de from DateTime (it's very not worth it, except perhaps as a learning exercise or masochism). More seriously getting date arithmetic right can be very hard. Your particular need doesn't sound too complicated now (compare two dates to a fixed date), but I still wouldn't choose

Re: script to compare dates

2009-08-18 Thread Mihir Kamdar
7,,*31-DEC-08* > > ,10,INR,,VOUCHER_BATCH_20080919_00024,1K,,0 > > > > Here I want to compare whether the 5th field, which is the date field > > is *earlier > > than 31-Mar-09 and 2nd field value is 2.* > > > > If yes, then I will take that record and s

Re: script to compare dates

2009-08-18 Thread Steve Bertrand
d field value is 2.* > > If yes, then I will take that record and store it in another file. > > Please help me as to how do I compare dates, preferably with some sample > code. > > I started coding for this as below, but am stuck on how to compare date in > my input

script to compare dates

2009-08-18 Thread Mihir Kamdar
help me as to how do I compare dates, preferably with some sample code. I started coding for this as below, but am stuck on how to compare date in my input with another date. #!/usr/bin/perl use strict; use warnings ; open (my $IN_FILE,"<","testdata.txt") or die $!."

Re: how to produce random dates

2008-09-21 Thread John W. Krahn
itshardtogetone wrote: - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> use Time::Local; my $start = timegm 0,0,0,1,0,60; my $end = timegm 0,0,0,1,0,86; print scalar gmtime $start + rand $end - $start; Hi, Thanks. (1) But the above from time to time produce the fol

Re: how to produce random dates

2008-09-21 Thread John W. Krahn
1960 to 1985 using rand like this : my $year = int (rand 26) + 1960; use Time::Local; my $start = timegm 0,0,0,1,0,60; my $end = timegm 0,0,0,1,0,86; print scalar gmtime $start + rand $end - $start; Time::Local only works for dates between Jan. 1, 1959 and Dec. 31, 2038. For dates outside of

Re: how to produce random dates

2008-09-20 Thread Mr. Shawn H. Corey
duce a random number between 1960 to 1985 using > > rand like this : > > > > my $year = int (rand 26) + 1960; > > use Time::Local; > > my $start = timegm 0,0,0,1,0,60; > my $end = timegm 0,0,0,1,0,86; > > print scalar gmtime $start + rand $end - $start; T

Re: how to produce random dates

2008-09-20 Thread John W. Krahn
itshardtogetone wrote: Hi, Hello, How do I randomly produce a date between 1st Jan 1960 to 31th December 1985. It must be able to show the day month year. I only know how to produce a random number between 1960 to 1985 using rand like this : my $year = int (rand 26) + 1960; use Time::Local

how to produce random dates

2008-09-20 Thread itshardtogetone
Hi, How do I randomly produce a date between 1st Jan 1960 to 31th December 1985. It must be able to show the day month year. I only know how to produce a random number between 1960 to 1985 using rand like this : my $year = int (rand 26) + 1960; Thanks

Re: regex question matching dates

2008-05-29 Thread Richard Lee
John W. Krahn wrote: } elsif ( $ARGV[0] =~ m/\b2008(0[1-9]|1[12])(0[1-9]|1[0-9]|2[0-9]|3[01])([01][0-9]|2[0-3])\b/ ) { ^ So you don't want to test for October? John fixed now. thanks!! } elsif ( $ARGV[0] =~ m/\b2008(0[1-9]|1[012])(0[1-9]|1[0-9]|2[0-9]|3[01])([01][

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary

Re: regex question matching dates

2008-05-28 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary at each end so it

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
John W. Krahn wrote: Richard Lee wrote: @array = qx#ls -tr $directory/$ARGV[0]*#; Why not do that directly in perl: @array = map $_->[0], sort { $a->[1] <=> $b->[1] } map [ $_, -M ], glob "$directory/$ARGV[0]*"; Sorry, that should be: @array = map $_->[0], sort { $b->[1] <

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary at each end so it will never match a ten

regex question matching dates

2008-05-28 Thread Richard Lee
given then ARGV[0] is 2008052803, why woulnd't below regex match them?? } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { @array = qx#ls -tr $directory/$ARGV[0]*#; #2008052803 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: User input: dates spanning multiple months

2007-09-10 Thread Chas Owens
On 9/10/07, Paul Lalli <[EMAIL PROTECTED]> wrote: snip > The above is also using the qw// operator, using < and > as the > delimiters. This creates a list of single quoted strings. So if the snip And the reason I chose <> is that in Perl 6 qw// is will be replaced by the diamond operator*. Also

Re: User input: dates spanning multiple months

2007-09-10 Thread Paul Lalli
On Sep 10, 1:18 pm, [EMAIL PROTECTED] (Mathew Snyder) wrote: > Thanks. But I'm confused by > > > my %start; @start{qw} = split /\//, shift; > > my %end; @end{qw} = split /\//, shift; > > What's happening here? Quite a bit, actually. Let's go right to left. First, shift() without an argument

Re: User input: dates spanning multiple months

2007-09-10 Thread Mathew Snyder
Chas Owens wrote: > On 9/10/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: >> I have a script which has to be manually edited to run for a span of days. >> When >> these days are over several weeks it can be clearly tedious to enter dates in >> -mm-dd format.

Re: User input: dates spanning multiple months

2007-09-10 Thread Mathew Snyder
erstein [mailto:[EMAIL PROTECTED] > Sent: 10 September 2007 14:33 > To: 'Mathew Snyder'; 'Perl Beginners' > Subject: AW: User input: dates spanning multiple months > > First I would use unix internal time format(epochen). > And I would use Date-Calc (search.cpan.org/d

Re: User input: dates spanning multiple months

2007-09-10 Thread Paul Lalli
On Sep 10, 7:18 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: > I have a script which has to be manually edited to run for a span of days. > When > these days are over several weeks it can be clearly tedious to enter dates in > -mm-dd format. I've decided to set it up to a

RE: User input: dates spanning multiple months

2007-09-10 Thread Andrew Curry
- From: Angerstein [mailto:[EMAIL PROTECTED] Sent: 10 September 2007 14:33 To: 'Mathew Snyder'; 'Perl Beginners' Subject: AW: User input: dates spanning multiple months First I would use unix internal time format(epochen). And I would use Date-Calc (search.cpan.org/dist/Date-Calc

RE: User input: dates spanning multiple months

2007-09-10 Thread Andrew Curry
http://www.unix.org.ua/orelly/perl/cookbook/ch03_06.htm -Original Message- From: Angerstein [mailto:[EMAIL PROTECTED] Sent: 10 September 2007 14:33 To: 'Mathew Snyder'; 'Perl Beginners' Subject: AW: User input: dates spanning multiple months First I would use unix

AW: User input: dates spanning multiple months

2007-09-10 Thread Angerstein
Snyder [mailto:[EMAIL PROTECTED] Gesendet: Montag, 10. September 2007 13:18 An: Perl Beginners Betreff: User input: dates spanning multiple months I have a script which has to be manually edited to run for a span of days. When these days are over several weeks it can be clearly tedious to enter

Re: User input: dates spanning multiple months

2007-09-10 Thread Chas Owens
On 9/10/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: > I have a script which has to be manually edited to run for a span of days. > When > these days are over several weeks it can be clearly tedious to enter dates in > -mm-dd format. I've decided to set it up to ask f

User input: dates spanning multiple months

2007-09-10 Thread Mathew Snyder
I have a script which has to be manually edited to run for a span of days. When these days are over several weeks it can be clearly tedious to enter dates in -mm-dd format. I've decided to set it up to ask for user input. What I need is some input on is how to make it create the arra

Re: dates

2006-10-10 Thread John W. Krahn
Tim Wolak wrote: > Just a quick easy one, while printing localtime, how do I get it to > print the full minutes and seconds, i.e. :02?? > > Thanks, > Tim > > my $date; > my ($sec,$min,$hour,$mday,$mon,$year) = (localtime) [0,1,2,3,4,5]; > $year=$year+1900; > $mon=$mon+1; > $date = sprintf("%02d%0

Re: dates

2006-10-10 Thread Rob Dixon
Tim Wolak wrote: Just a quick easy one, while printing localtime, how do I get it to print the full minutes and seconds, i.e. :02?? Thanks, Tim my $date; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime) [0,1,2,3,4,5]; $year=$year+1900; $mon=$mon+1; $date = sprintf("%02d%02d%02d\_$hour\:$min\

RE: dates

2006-10-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Subject: dates Just a quick easy one, while printing localtime, how do I get it to print the full minutes and seconds, i.e. :02?? Thanks, Tim my $date; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime) [0,1,2,3,4,5]; $year=$year+1900; $mon=$mon+1; $date = sprintf("%02d%02d%02d\_$hour\:$min\

dates

2006-10-10 Thread Tim Wolak
Just a quick easy one, while printing localtime, how do I get it to print the full minutes and seconds, i.e. :02?? Thanks, Tim my $date; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime) [0,1,2,3,4,5]; $year=$year+1900; $mon=$mon+1; $date = sprintf("%02d%02d%02d\_$hour\:$min\:$sec", $year,$mon,

Re: Comparing dates

2006-06-25 Thread John W. Krahn
ebony smith wrote: > I am new to perl and need to compare some dates in a file stored in > dd-mm- format to find out if the dates are greater than 30, 60 or 90 > days. > However, I am not quite sure how to go about doing that in perl and I > was wondering if anyone out there

Re: Comparing dates

2006-06-25 Thread Anthony Ettinger
Date::Calc On 6/25/06, ebony smith <[EMAIL PROTECTED]> wrote: I am new to perl and need to compare some dates in a file stored in dd-mm- format to find out if the dates are greater than 30, 60 or 90 days. However, I am not quite sure how to go about doing that in perl and I was won

Comparing dates

2006-06-25 Thread ebony smith
I am new to perl and need to compare some dates in a file stored in dd-mm- format to find out if the dates are greater than 30, 60 or 90 days. However, I am not quite sure how to go about doing that in perl and I was wondering if anyone out there had any tips on how to do this. I extract

RE: Dates again.

2005-12-05 Thread Rafael Morales
ohnson" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], "Rafael Morales" <[EMAIL PROTECTED]> Subject: RE: Dates again. Date: Mon, 5 Dec 2005 10:32:29 -0800 > > > localtime() returns an array with populated with the details about the > current time and date (unless y

Re: Re: Dates again.

2005-12-05 Thread Beau E. Cox
Rafael Morales <[EMAIL PROTECTED]>: > >> Hi to all !!! >> >> Now I have a new trouble with dates. How can I know the date of 72 days ago >> ?. For example for get 2005-12-05, I do this >> >> use POSIX qw(strftime

RE: Dates again.

2005-12-05 Thread Timothy Johnson
ven easier: my $dateInThePast = time - 72 * 86400; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 9:10 AM To: Rafael Morales Cc: beginners@perl.org Subject: Re: Dates again. I am assuming that localtime() returns the time in unix f

Re: Dates again.

2005-12-05 Thread vmalik
long these line. Quoting Rafael Morales <[EMAIL PROTECTED]>: > Hi to all !!! > > Now I have a new trouble with dates. How can I know the date of 72 days ago > ?. For example for get 2005-12-05, I do this > > use POSIX qw(strftime); > > my $today = strftime "%Y-%m%d

Dates again.

2005-12-05 Thread Rafael Morales
Hi to all !!! Now I have a new trouble with dates. How can I know the date of 72 days ago ?. For example for get 2005-12-05, I do this use POSIX qw(strftime); my $today = strftime "%Y-%m%d", localtime(); I would like to get this date: 2005-09-21. T

Re: Dates

2005-11-04 Thread Jeff 'japhy' Pinyan
On Nov 4, Scott Taylor said: I have a date in UT that looks like this: "2005-11-02 01:36:00.0" Can anyone tell me the best way to subtract 8 hours from it, or to convert it to PDT? I'm reading up on Date::Manip, but I don't know if that is going to help, yet. Date::Manip can probably do it,

RE: Dates

2005-11-04 Thread Timothy Johnson
Check out the Time::Local module. It will let you convert your text date into Perl time() format. -Original Message- From: Scott Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 11:36 AM To: beginners@perl.org Subject: Dates Hello, I have a date in UT that looks like

Dates

2005-11-04 Thread Scott Taylor
Hello, I have a date in UT that looks like this: "2005-11-02 01:36:00.0" Can anyone tell me the best way to subtract 8 hours from it, or to convert it to PDT? I'm reading up on Date::Manip, but I don't know if that is going to help, yet. Cheers. -- Scott -- To unsubscribe, e-mail: [EMAIL PR

Re: Help with hash of dates

2005-08-08 Thread Kevin Old
On 8/8/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > On Aug 8, Kevin Old said: > > > I'm trying to come up with a way to automatically create a hash like > > the following: > > > > It's a hash with the start and end date for each week with the start > > date being Sunday and the end date be

Re: Help with hash of dates

2005-08-08 Thread Jeff 'japhy' Pinyan
On Aug 8, Kevin Old said: I'm trying to come up with a way to automatically create a hash like the following: It's a hash with the start and end date for each week with the start date being Sunday and the end date being the following Saturday. You can use localtime() and the Time::Local modul

Help with hash of dates

2005-08-08 Thread Kevin Old
'start' => '05/08/05', 'end' => '05/14/05' }, ); It's a hash with the start and end date for each week with the start date being Sunday and the end date being the following Saturday. I know all about Dat

Re: Dates

2005-01-07 Thread Scott R. Godin
Jeff Eggen wrote: Tim Wolak <[EMAIL PROTECTED]> 06/01/2005 3:59:26 pm >>> Hello all, I am in need of a quick way to get the current date in the MMDD format. This is something I would like to understand better on how to get the date with perl. Any suggestions would be most welcome. As per t

Re: Dates

2005-01-06 Thread Owen Cook
On Thu, 6 Jan 2005, Tim Wolak wrote: > I am in need of a quick way to get the current date in the MMDD > format. This is something I would like to understand better on how to > get the date with perl. Any suggestions would be most welcome. You need to read up on localtime.

Re: Dates

2005-01-06 Thread Jeff Eggen
>>> Tim Wolak <[EMAIL PROTECTED]> 06/01/2005 3:59:26 pm >>> >Hello all, >I am in need of a quick way to get the current date in the MMDD >format. This is something I would like to understand better on how to >get the date with perl. Any suggestions would be most welcome. As per the perlch

Re: Dates

2005-01-06 Thread Markus Mayr
Tim Wolak wrote: Hello all, I am in need of a quick way to get the current date in the MMDD format. This is something I would like to understand better on how to get the date with perl. Any suggestions would be most welcome. Tim Hi. You're probably looking for localtime? > perldoc -f local

Dates

2005-01-06 Thread Tim Wolak
Hello all, I am in need of a quick way to get the current date in the MMDD format. This is something I would like to understand better on how to get the date with perl. Any suggestions would be most welcome. Tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Dates are killing me..

2004-07-07 Thread Jeff 'japhy' Pinyan
On Jul 7, Chris Charley said: >Like Luke's solution, but using Date::Simple which comes with the standard >distro of Perl. > >#!/usr/bin/perl >use strict; >use warnings; >use Date::Calc qw/ Day_of_Week Add_Delta_Days /; This uses Date::Calc, not Date::Simple... and neither of those came with *my*

Re: Dates are killing me..

2004-07-07 Thread Chris Charley
Like Luke's solution, but using Date::Simple which comes with the standard distro of Perl. #!/usr/bin/perl use strict; use warnings; use Date::Calc qw/ Day_of_Week Add_Delta_Days /; my @days = (undef, qw/ Mon Tue Wed Thur Fri Sat Sun /); if ($ARGV[0] !~ /^\d{4}-\d{2}-\d{2}$/) { die "Date given

Re: Dates are killing me..

2004-07-07 Thread Chris Puccio
Luke, Thanks!!! Works exactly as needed! -c On Wednesday 07 July 2004 09:41 am, Bakken, Luke wrote: > > Hi Guys, > > > > I'm having a real hard time trying to figure this out.. > > > > There are tons of modules on dates, etc, but I can't seem to >

RE: Dates are killing me..

2004-07-07 Thread Bakken, Luke
> Hi Guys, > > I'm having a real hard time trying to figure this out.. > > There are tons of modules on dates, etc, but I can't seem to > find one to do > what I need. > > I have one date, for example: 2004-07-07. > > I need to take that date, g

Re: Dates are killing me..

2004-07-07 Thread Johan Viklund
;t be too hard I think. ons 2004-07-07 klockan 06.03 skrev Chris Puccio: > Hi Guys, > > I'm having a real hard time trying to figure this out.. > > There are tons of modules on dates, etc, but I can't seem to find one to do > what I need. > > I have one date,

Dates are killing me..

2004-07-07 Thread Chris Puccio
Hi Guys, I'm having a real hard time trying to figure this out.. There are tons of modules on dates, etc, but I can't seem to find one to do what I need. I have one date, for example: 2004-07-07. I need to take that date, get Monday's date and Sunday's date where 2004-07-

RE: Subtracting Zero Dates

2004-06-18 Thread Tim Johnson
] Cc: Subject: Re: Subtracting Zero Dates they are all ready in time format, that is the problem. Example: $time1 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $time2 = Date_to_Time($year,$month,$day, $h

Re: Subtracting Zero Dates

2004-06-18 Thread Werner Otto
they are all ready in time format, that is the problem. Example: $time1 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $time2 = Date_to_Time($year,$month,$day, $hour,$min,$sec); $difference = $time1 - $time2; One way: Convert both dates to Perl time() format, then subtract

RE: Subtracting Zero Dates

2004-06-18 Thread Tim Johnson
One way: Convert both dates to Perl time() format, then subtract. -Original Message- From: Werner Otto [mailto:[EMAIL PROTECTED] Sent: Fri 6/18/2004 3:28 AM To: [EMAIL PROTECTED] Cc: Subject: Subtracting Zero Dates

Subtracting Zero Dates

2004-06-18 Thread Werner Otto
Hi All, Does anyone know how to handle subtracting two dates where one might be 0 or no time or blank? -- Kind Regards, Werner Otto -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: getting in between dates in a hash

2004-02-16 Thread Jan Eden
evel = ( 2001-10-14 => 152, 2002-01-15 => 163, 2003-03-13 => >210, 2004-08-07 => 307 ); > >And I am give some dates in between: > >@dates = ( 2001-12-30, 2002-03-19); > >I need to find what the highest level was on that date, matching >between known dates.

Re: Range of dates help needed

2003-11-07 Thread John W. Krahn
)[3,4,5]; > $year += 1900; > $month++; > my $beginyear = &ParseDate("$year/01/01"); > my $today = &ParseDate("today"); > my $firsttues = &ParseDate("$year/01/07"); > my $endyear = &ParseDate("$ye

Re: Range of dates help needed

2003-10-30 Thread Rob Dixon
=> '11/14/2003', > > > '11/15/2003' => '11/21/2003', > > > '11/22/2003' => '11/28/2003', > > > ); > > > > > > > This seemed like a fun exercise so I wrote the program below. It builds > > an

Re: Range of dates help needed

2003-10-30 Thread Kevin Old
1/2003', > > '11/22/2003' => '11/28/2003', > > ); > > > > This seemed like a fun exercise so I wrote the program below. It builds > an array of eight elements, each of which is a reference to a two-element > array containing the start and end dat

Re: Range of dates help needed

2003-10-30 Thread Rob Dixon
; $month++; > my $beginyear = &ParseDate("$year/01/01"); > my $today = &ParseDate("today"); > my $firsttues = &ParseDate("$year/01/07"); > my $endyear = &ParseDate("$year/12/31"); > >

Range of dates help needed

2003-10-29 Thread Kevin Old
quot;); my $today = &ParseDate("today"); my $firsttues = &ParseDate("$year/01/07"); my $endyear = &ParseDate("$year/12/31"); #print "$beginyear $endyear\n"; #Build an array of every Tuesday in the current year

  1   2   >