RE: How to get yesterday's date in Perl

2008-12-05 Thread zilore mumba
Thank you to all who contributed to this discussion. Not only did this assist me in my problem, but I learnt a lot from the various contributions. Thanks so muchZilore ___ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscr

RE: How to get yesterday's date in Perl

2008-12-03 Thread Bourgneuf Francois
Luebkert > Envoyé : jeudi 4 décembre 2008 00:49 > À : activeperl@listserv.activestate.com > Objet : Re: How to get yesterday's date in Perl > > [EMAIL PROTECTED] wrote: > >> This occurs on the 23th hour in the fall and the 0th hour > in the spring. > > This pro

Re: How to get yesterday's date in Perl

2008-12-03 Thread Bill Luebkert
[EMAIL PROTECTED] wrote: >> This occurs on the 23th hour in the fall and the 0th hour in the spring. > This program shows a brute force way >> to find these that might convince you [1]. > > > Slick! I'm convinced. Hmm, so if you need it to be ever accurate (and want > to stay w/ localtime() you

Re: How to get yesterday's date in Perl

2008-12-03 Thread Andy_Bach
> now I'm confused ... my ($isdst) = ( localtime() ) [8]; my ($mday, $mon, $year, $prev_isdst) = (localtime(time - 60 * 60 * 24) )[ 3,4,5, 8]; printf("%d/%02d/%02d\n", $year + 1900, $mon + 1, $isdst == $prev_isdst ? $mday : $isdst > $prev_isdst ? (localtime($t - 60 * 60 * 23) )[ 3] :

RE: How to get yesterday's date in Perl

2008-12-03 Thread Henry Hartley
[EMAIL PROTECTED] >> > This occurs on the 23th hour in the fall and the 0th hour in the >> > spring. This program shows a brute force way to find these that >> > might convince you [1]. >> > >> Slick! I'm convinced. Hmm, so if you need it to be ever accurate >> (and want to stay w/ localtime() yo

Re: How to get yesterday's date in Perl

2008-12-03 Thread Andy_Bach
> This occurs on the 23th hour in the fall and the 0th hour in the spring. This program shows a brute force way > to find these that might convince you [1]. Slick! I'm convinced. Hmm, so if you need it to be ever accurate (and want to stay w/ localtime() you need to track changes in the DST fiel

Re: How to get yesterday's date in Perl

2008-12-03 Thread Gisle Aas
On Dec 3, 2008, at 10:25 , [EMAIL PROTECTED] wrote: >Yes. There are 2 hours each year when this formula is wrong. I assume you're thinking of the switch from DST to CST and vice- versa, yes? But since that change occurs at oh-dark-hundred (2:00AM), it's already "today," and "yesterday" wo

Re: How to get yesterday's date in Perl

2008-12-03 Thread Andy_Bach
>Yes. There are 2 hours each year when this formula is wrong. No, there are 2 hours each year where the 'time' fields wouldn't be exactly 24 hours earlier, but the date should be skookum > More seriously, isn't this code subtracting a day twice? my ($mday, $mon, $year) = (localtime(time()

Re: How to get yesterday's date in Perl

2008-12-03 Thread Deane . Rothenmaier
>Yes. There are 2 hours each year when this formula is wrong. I assume you're thinking of the switch from DST to CST and vice-versa, yes? But since that change occurs at oh-dark-hundred (2:00AM), it's already "today," and "yesterday" would be the same, wouldn't it? Or is it a different pair o

Re: How to get yesterday's date in Perl

2008-12-03 Thread Gisle Aas
On Dec 3, 2008, at 8:34 , Henry Hartley wrote: > [EMAIL PROTECTED] wrote: > >>> (by default, 'time()' is the param for localtime() ). So you can >>> get the values for yest by subtracting 1 day worth of seconds: >>> my ($mday, $mon, $year) = (localtime(time() - 60 * 60 * 24) ) >>> [ 3,4,5]; >>>

RE: How to get yesterday's date in Perl

2008-12-03 Thread Henry Hartley
[EMAIL PROTECTED] wrote: >> (by default, 'time()' is the param for localtime() ). So you can >> get the values for yest by subtracting 1 day worth of seconds: >> my ($mday, $mon, $year) = (localtime(time() - 60 * 60 * 24) ) [ 3,4,5]; >> printf("%d/%02d/%02d\n", $year + 1900, $mon + 1, $mday - 1);

RE: How to get yesterday's date in Perl

2008-12-03 Thread Andy_Bach
> After browsing a lot of documentation I cannot find how to get yesterday's or tomorrow's date in Perl, like `date --date "-1 day" "+%Y%m%d"` in bash. localtime() takes an epoc number (number of seconds from 1/1/1970) and produces either the date data list (perldoc -f localtime):: # 01

RE: How to get yesterday's date in Perl

2008-12-03 Thread Henry Hartley
yestm/$yestd/$yesty\n" ; -- Henry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zilore mumba Sent: Wednesday, December 03, 2008 10:09 AM To: activeperl@listserv.activestate.com Subject: RE: How to get yesterday's date in Perl thanks for the resp

RE: How to get yesterday's date in Perl

2008-12-03 Thread zilore mumba
thanks for the response, but it is still not clear to me. What do I put in qw(Add_Delta_Days)? Thanks Zilore --- On Wed, 12/3/08, Singer, Erich <[EMAIL PROTECTED]> wrote: From: Singer, Erich <[EMAIL PROTECTED]> Subject: RE: How to get yesterday's date in Perl To: [EMAIL PROTE

RE: How to get yesterday's date in Perl

2008-12-03 Thread Singer, Erich
Hello use Date::Calc qw(Add_Delta_Days) Erich From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zilore mumba Sent: Wednesday, December 03, 2008 7:05 AM To: activeperl@listserv.activestate.com Subject: How to get yesterday's date in Perl After b

Re: How to get yesterday's date in Perl

2008-12-03 Thread Angelos Karageorgiou
time - 24*60*60 is a quick guess zilore mumba wrote: After brouwsing a lot ofdocumentation I cannot find how to get yesterday's or tomorrow's date in Perl, like `date --date "-1 day" "+%Y%m%d"` in bash. Is this possible in Perl? I am making date directories, like 20081203. If I add, I get a

Re: How to get yesterday's date in Perl

2008-12-03 Thread Jenda Krynicky
From: zilore mumba <[EMAIL PROTECTED]> > After brouwsing a lot ofdocumentation I cannot find how to get > yesterday's or tomorrow's date in Perl, like `date --date "-1 day" > "+%Y%m%d"` in bash. Is this possible in Perl? > > I am making date directories, like 20081203. If I add, I get a problem >