Ask a Question related to PERL Modules, Design and Development.
-
thomas.reiss@gmx.de #1
add_delta_days: 30.06.2006 +1 Day = 01.07.2006?
Hi,
attention, Beginner!
I'm wondering about the calculation from Modul Date::Calc.
The Code:
sub ids_tomorrow() {
my($year,$month,$day) = Add_Delta_Days(((localtime)[5,4,3]),1);
$year=$year+1900;
printf("Id's, tommorow: %02d.%02d.%04d\n",$day,$month,$year);
}
give me (called on 30.06.2006) as Resoult the Date 01.07.2006?
It should be 31.06.2006.
What made i wrong?
"Date::Calc" version 5.4
Perl: Ver. 5.8.8
Thanx for Help
Thomas
thomas.reiss@gmx.de Guest
-
23rd September, 2006
Polly Ip -
[Windows Uninstaller Updated 5/11/2006]
We've made some revisions in the Flash Player uninstaller which should help eliminate some pain for IE Windows users having Flash Player issues. ... -
Parameter Type Conflict: sqlType=2006
HiAll, migrating from CF5 to MX7 and using cfprocresult causes the following error: Parameter Type Conflict: sqlType=2006 VENDORERRORCODE ... -
Official: Vista release in November 2006
This is the year… the year that Microsoft releases the newest version of Windows. Yes, Vista will be released in November of this year. So what is... -
starter pages for 2006 calendars
Hi contribute 3.11 only has calendars for 2004 and 2005 under new page -> starter web pages -> basic pages -> calendars. Is there any way to get... -
Mark Clements #2
Re: add_delta_days: 30.06.2006 +1 Day = 01.07.2006?
[email]thomas.reiss@gmx.de[/email] wrote:
June only has 30 days.> Hi,
>
> attention, Beginner!
>
> I'm wondering about the calculation from Modul Date::Calc.
>
> The Code:
>
> sub ids_tomorrow() {
> my($year,$month,$day) = Add_Delta_Days(((localtime)[5,4,3]),1);
> $year=$year+1900;
> printf("Id's, tommorow: %02d.%02d.%04d\n",$day,$month,$year);
> }
>
> give me (called on 30.06.2006) as Resoult the Date 01.07.2006?
> It should be 31.06.2006.
> What made i wrong?
>
> "Date::Calc" version 5.4
> Perl: Ver. 5.8.8
>
Mark
Mark Clements Guest
-
thomas.reiss@gmx.de #3
Re: add_delta_days: 30.06.2006 +1 Day = 01.07.2006?
Mark Clements schrieb:
Upps, sorry my mistake, i live at the wrong Month ;-)> [email]thomas.reiss@gmx.de[/email] wrote:>> > Hi,
> >
> > attention, Beginner!
> >
> > I'm wondering about the calculation from Modul Date::Calc.
> >
> > The Code:
> >
> > sub ids_tomorrow() {
> > my($year,$month,$day) = Add_Delta_Days(((localtime)[5,4,3]),1);
> > $year=$year+1900;
> > printf("Id's, tommorow: %02d.%02d.%04d\n",$day,$month,$year);
> > }
> >
> > give me (called on 30.06.2006) as Resoult the Date 01.07.2006?
> > It should be 31.06.2006.
> > What made i wrong?
> >
> > "Date::Calc" version 5.4
> > Perl: Ver. 5.8.8
> >
> June only has 30 days.
>
> Mark
The Skript was not called on 06/2006 but on 07/2006!
But Your hint was very usefull.
localtime returns the month beginning with 0 for January,
Add_Delta_Days await the January with 1 !
so i have to add 1 to $month.
Thank's for help
Thomas
thomas.reiss@gmx.de Guest



Reply With Quote

