Subject | Converting dates and the ISO-8601 format |
---|---|
Author | |
Post date | 2018-11-09T12:38:23Z |
Hi -
I use Firebird primarily with Delphi and have had no problems with using 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).
I really dont know how to format the results so that they appear "normal" for my region - ie the dd/mm/yyyy format. I also am not sure where the problem originates. It seems to depend on the client software I am using to view the data (which seems to imply its the client software that is responsible for rendering the data.)
Here is a summary of software I have tried and the results
Program result
FlameRobin Formatted correctly (except using the "." notation - so dd.mm.yy
DBeaver Formatted incorrect for my region ( ISO-8601 format)
PhP Formatted incorrect for my region ( ISO-8601 format)
Delphi (VCL) Formatted correctly dd/mm/yyyy
My question can be sumerised as - How to format the results so they are correct for a specific region (in this case the UK )? Should the client software (PhP/DBeaver etc) have a setting that allows you to format the results correctly ? Becasue I cant find any global setting in the various clients that will allow this.
If we do have to explicitly cast / format the data - this adds a lot of work on the server / software and surely must have performance issues ?
My goal is to format the result from a PhP request so the dates are displayed correclty. I understand that Firebird does not have the"convert" function - so I have tried using the "CAST" function - but this seems to do very little
for example..
cast(TRANSDATE AS DATE) as TRANS_CREATED
This seems to do nothing. I have tried looking through the PhP.ini file for some way to influence how the data is formatted and cannot find anything. I have even tried using ..
ini_set('date.timezone', 'Europe/London');
But this also did nothing.
Please advise.
Many thanks..