Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Problem with DATETIME value.
Date: Apr 24 1998 3:23PM
Steve Allen writes:
> I have a problem with using datetime can anybody help,
> The following code can be run any number of times depending on how many
> times the user select next from a selection box, but on the third
> attempt all seems ok if print the values before for mon,year,day all
> seems fine but after passing into the newdate function it is reset to 1
> jan 1900, but it works the first two times.?
> $startdate = Sybase::DBlib::DateTime;
This line doesn't make any sense. I guess you're trying to say the
$startdate should be of type Sybase::DBlib::DateTime, but what you're
actually doing (because you probably are not running with 'use strict'
turned on) is setting it to the string 'Syabse::DBlib::DateTime'.
The type of the variable (or more precisely, the package into which a
reference is blessed) is handled in newdate().
That said I can't really see anything else that is wrong in your
code. I would suggest turning on full warnings (-w) and use strict and
then seeing what happens. Also, you can run the code in the perl
debugger to see what happens, and check the web server's error log for
Michael Peppler -||- Data Migrations Inc.
email@example.com -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com