Re: silinging warnings?
| From: | John Lim | Date: | Sat, 28 Jun 2003 14:34:45 +0000 |
| Subject: | Re: silinging warnings? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17823@lists.php.net to get a copy of this message | ||
Hi Lukas,
That's why I wrote this, to handle negative timestamps.
http://php.weblogs.com/adodb_date_time_library
Feel free to use/improve.
Regards, John
"Lukas Smith" <smith@backendmedia.com> wrote in message
news:002101c33d5d$2d4e39a0$4e00a8c0@vandal...
> Hi,
>
> I have a question about MDB_Date that might result in a standard we may
> want to set:
>
> MDB_Date is a very simple class to help people convert their timestamps
> from and to the MDB timestamp format (which essentially is an ISO date).
>
> Due to its simple nature it uses something like the following to convert
> form a unix timestamp to an MDB timestamp:
> function unix2Mdbstamp($unix_timestamp)
> {
> return date('Y-m-d H:i:s', $unix_timestamp);
> }
>
> This can lead to odd results if the unix timestamp is less than 0. I
> want to keep the code as simple as possible, because people can move to
> the PEAR::Date if they need anything more fancy.
>
> So should I silence the errors that may come up due to the date() call?
> Should the users make the necessary checks in his code to prevent
> calling with a unix timestamp less than 0?
> Again I would prefer not to have to introduce any fancy code to handle
> values outside the scope.
>
> Regards,
> Lukas Smith
> smith@backendmedia.com
> _______________________________
> BackendMedia
> www.backendmedia.com
> berlin@backendmedia.com
>
> Linn Zwoch Smith GbR
> Pariser Str. 44
> D-10707 Berlin
>
> Tel +49 30 83 22 50 00
> Fax +49 30 83 22 50 07
>
>