Page 1 of 1

date format

Posted: 05.05.2008, 15:50
by okparanoid
Hi !

I use Zeos Component with a Postgres 8.1 database.
The datestyle is set to ISO, DMY.

When i want retrieve a dateField value with my component with an
fieldbyname('mdateyfield').asstring i obtain a date with a dd/mm/yyyy format.

I would like to obtain a ISO format instead and don't understant why that's not the default result. How can i do this ?

Thanks !

BR

Posted: 06.06.2008, 12:54
by Gerard
I haven't checked but i think that when you use the .AsString method it uses the 'Short Date' format specified by windows (Held in SysUtils?)

Try using the .AsDateTime to get a datetime value and then use the (SysUtils) FormatDateTime function to convert that into a string with the formatting parameters you require.