Subject | Re: [firebird-support] Converting dates and the ISO-8601 format |
---|---|
Author | Mark Rotteveel |
Post date | 2018-11-10T08:16:35Z |
On 9-11-2018 13:38, info@... [firebird-support] wrote:
https://secure.php.net/manual/bg/function.ibase-timefmt.php; that seems
to be a function that has been removed, but one of the comments suggested:
```
/**
* Constant definitions that has been removed from PHP 5
*/
const IBASE_DATE = "ibase.dateformat";
const IBASE_TIME = "ibase.timeformat";
const IBASE_TIMESTAMP = "ibase.timestampformat";
/**
* Sets the format of timestamp, date or time type
* columns returned from queries
*/
function ibase_timefmt($format, $where = IBASE_TIMESTAMP)
{
ini_set($where, $format);
}
```
And https://secure.php.net/manual/en/ibase.installation.php (see first
comment) suggests this can also be configured in the php.ini file.
Mark
--
Mark Rotteveel
> I use Firebird primarily with Delphi and have had no problems with usingDisclaimer: I don't use PHP, but a quick google suggested
> and displaying dates (suitable for my country - UK.)
>
> However, it seems to be a big problem with Firebird and dates when
> working with PhP with firebird driver. I have a number of fields that
> hold information in a field defined to be of type "date" in Firebird.
> When I use PhP to query my database I get the fields formatted in the
> ISO-8601 format (year/month/day.. etc).
https://secure.php.net/manual/bg/function.ibase-timefmt.php; that seems
to be a function that has been removed, but one of the comments suggested:
```
/**
* Constant definitions that has been removed from PHP 5
*/
const IBASE_DATE = "ibase.dateformat";
const IBASE_TIME = "ibase.timeformat";
const IBASE_TIMESTAMP = "ibase.timestampformat";
/**
* Sets the format of timestamp, date or time type
* columns returned from queries
*/
function ibase_timefmt($format, $where = IBASE_TIMESTAMP)
{
ini_set($where, $format);
}
```
And https://secure.php.net/manual/en/ibase.installation.php (see first
comment) suggests this can also be configured in the php.ini file.
Mark
--
Mark Rotteveel