RE: [PHP] format date
| From: | Mark Roedel | Date: | Tue, 23 Oct 2001 14:41:31 +0000 |
| Subject: | RE: [PHP] format date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-71948@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Caleb Carvalho [mailto:havanero@hotmail.com]
> Sent: Tuesday, October 23, 2001 2:53 AM
> To: huntsman@www.nisu.flinders.edu.au; php-general@lists.php.net
> Subject: Re: [PHP] format date
>
>
> I am inserting into table
> values('$product','$title,'$date')
>
> the date field gets added by default, like time stamp,
Does $date have a value at this point? What is it?
> when i view the contents added to database i see date field showing
> ex:
>
> display.php
>
> $product, $title, $date
> ................................................
> mango good fruit Jan 1 1900 12:00:00:000AM
This looks to me suspiciously like Sybase is seeing either an empty/zero
value or one that it's not able to parse as a date and time. Are you
*sure* that the column type you're using is supposed to automagically
insert a current timestamp? If so, you might double-check your
documentation to see under what circumstances it will do so...it might
only do it, for example, if you insert a NULL value (which is not the
same as an empty string). If not, you could try using the now()
function in your insert query instead of specifying a '$date' value.
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell