Subject | Re: [firebird-php] TIME Configuration... |
---|---|
Author | Teträm Corp |
Post date | 2007-08-14T17:37:52Z |
Hi,
whatever the version of php or firebird you use, dates and times are
client-side formated.
So everytime you see a time or a date resulting of your script, the
format is depending of (in your case) php/system configuration.
Everytime!!
even if it's not php but python, C, Delphi... everytime!
so if you want use date and time as string, you MUST specify the format
you need... EVERYTIME :-)
so, as in date function, you MUST use functions that have date/time
format parameter (or MUST set date/time parameters for generic functions
to be sure they are what you need).
in your case, you have too choices:
- change php date/time parameters (if you can)
- use date/time functions with a format parameter
and last, if your database field is DATE, TIME or TIMESTAMP please NEVER
read them as string (I saw strtotime($o->HORA...) in your code).
Specially if you need a specific format (for parsing, echoing or
anything else)
the only case you can't control the date/time format is when you do:
select cast(HORA_INICIO1 as varchar(20)) from etc
this way, the format will EVER be in SQL92 format. It's not depending
system/firebird/php or anything else configuration.
Thierry
luluzynha13 a écrit :
whatever the version of php or firebird you use, dates and times are
client-side formated.
So everytime you see a time or a date resulting of your script, the
format is depending of (in your case) php/system configuration.
Everytime!!
even if it's not php but python, C, Delphi... everytime!
so if you want use date and time as string, you MUST specify the format
you need... EVERYTIME :-)
so, as in date function, you MUST use functions that have date/time
format parameter (or MUST set date/time parameters for generic functions
to be sure they are what you need).
in your case, you have too choices:
- change php date/time parameters (if you can)
- use date/time functions with a format parameter
and last, if your database field is DATE, TIME or TIMESTAMP please NEVER
read them as string (I saw strtotime($o->HORA...) in your code).
Specially if you need a specific format (for parsing, echoing or
anything else)
the only case you can't control the date/time format is when you do:
select cast(HORA_INICIO1 as varchar(20)) from etc
this way, the format will EVER be in SQL92 format. It's not depending
system/firebird/php or anything else configuration.
Thierry
luluzynha13 a écrit :
> Besides the php.ini configuration and the LOCALE settings of the
> server what else can affect the time data? I've been having problems
> with retrieving TIME data from my database and displaying it correctly
> in my php apllication.
>
> The Upgrading information is:
> Old Version - New version
> php 4.* - php 5.2.*
> firebird 1.5.2.* - firebird2 1.5.3.48*
>
> Besides PHP.ini directives and LOCALE settings on the server there is
> anything else I should look for? Plus... Is there a way to make the
> time completelly independent from php?
>
> Thank you!
>
> Lu
>