Date issue

Hi,
I am running MySQL 4.0.14 with PHP 5.1.4.
I have a table where I'm writing a timestamp field with the now() variable.

When I try to read it (formatted or not), I get a weird date output Year
1933 or 1907.

Any specific setting I'm missing to output my date properly?

Thx in advance.

K.
Babanou [ Do, 29 Juni 2006 03:25 ] [ ID #1375265 ]

Re: Date issue

"Babanou" <mephisto66 [at] yahoo.com> wrote in message
news:h%Fog.112328$8i2.579044 [at] wagner.videotron.net...

NOW() returns the current date and time in a specific format. If you are attempting to
modify that format, that may be your problem.

-Lost
-Lost [ Do, 29 Juni 2006 04:10 ] [ ID #1375266 ]

Re: Date issue

So there is absolutely no way to modify the format?

If I want to do so, what should I use?

Thx.



"-Lost" <spam_ninjaREMOVEME [at] REMOVEMEcomcast.net> wrote in message
news:K4OdnUTBXYf2qz7ZnZ2dnUVZ_vednZ2d [at] comcast.com...
> "Babanou" <mephisto66 [at] yahoo.com> wrote in message
> news:h%Fog.112328$8i2.579044 [at] wagner.videotron.net...
>
> NOW() returns the current date and time in a specific format. If you are
> attempting to modify that format, that may be your problem.
>
> -Lost
>
Babanou [ Do, 29 Juni 2006 12:14 ] [ ID #1375267 ]

Re: Date issue

Babanou wrote:
> So there is absolutely no way to modify the format?
>
> If I want to do so, what should I use?

I'd use UNIX_TIMESTAMP() in mysql_database, and take care of the formatting
in PHP using strftime().

Grtz,
--
Rik Wasmus
Rik [ Do, 29 Juni 2006 14:01 ] [ ID #1375268 ]

Re: Date issue

Great thx.
strtotime works...

..K.


"Rik" <luiheidsgoeroe [at] hotmail.com> wrote in message
news:25496$44a3c0cb$8259c69c$31314 [at] news2.tudelft.nl...
> Babanou wrote:
>> So there is absolutely no way to modify the format?
>>
>> If I want to do so, what should I use?
>
> I'd use UNIX_TIMESTAMP() in mysql_database, and take care of the
> formatting
> in PHP using strftime().
>
> Grtz,
> --
> Rik Wasmus
>
>
Babanou [ Fr, 30 Juni 2006 15:01 ] [ ID #1376471 ]
PHP » alt.php.sql » Date issue

Vorheriges Thema: PHP/SQL Question
Nächstes Thema: how do I drop a foreign key in MySQL 4