date format

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
okparanoid
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 13.03.2007, 12:11

date format

Post 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
Gerard
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 31.10.2005, 21:32

Post 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.
Post Reply