MLUG: Re: [MLUG] Perl & mySQL question (Dying, help)
Re: [MLUG] Perl & mySQL question (Dying, help)
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I usually use a unix time rather than the SQL timedate. It makes it less
hassle to work with in my experience. Unless you are planning on using the
db on a mahine that can't use unix timestamps I've found no reason not to
do it that way.

*^*^*^*
Michael McGlothlin <EMAIL:PROTECTED>
http://mlug.missouri.edu/~mogmios/projects/

On Thu, 6 Dec 2001, M. Kovalenko wrote:

> "Davis, Ryan Wiley (UMC-Student)" wrote:
> > 
> [...]
> > my $createtime = (now());
> [...]
> > it is in the 0000-00-00 00:00:00 format (datetimecreated DATETIME NOT NULL).
> 
> I don't know of now() function in perl. I'd use localtime() (from man
> perlfunc):
> 
> $now_string = localtime;  # result: "Thu Oct 13 04:54:34 1994"
> 
> But if you're using DATETIME type for datetimecreated field and not
> TEXT, I bet it requires specific format, like '12/6/2001' or something.
> INSERT won't work like that. You'll have to do some text manipulation on
> localtime() output or call `/bin/date` with the correct +FORMAT string.
> 
> -- MK
> --
> To unsubscribe, go to http://mlug.missouri.edu/members/edit.php
> 
> Archives are available at http://mlug.missouri.edu/list-archives/
> 

--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php

Archives are available at http://mlug.missouri.edu/list-archives/