Postgres - datum
Honza Pazdziora
adelton na informatics.muni.cz
Středa Červen 16 12:19:57 CEST 2004
On Wed, Jun 16, 2004 at 12:10:14PM +0200, Ildiko Takacsova wrote:
>
> v MySQL mozem pouzit
>
> SELECT Date_Format(s1datum, '%d.%m.%Y') AS datum
>
> a dostanem datum v tvare den.mesiac.rok
>
> Ako to mam spravit v Postgrese?
>
> Mam napriklad datum 31. januar 2000 v standartnom ISO tvare
> 2000-01-31
>
> a chcem vystupny tvar
> 31.01.2000
select to_char(current_date, 'DD.MM.YYYY')
Pokud mate vstup jako retezec, tak pres to_date na datum a pak zpet na
retezec:
select to_char(to_date('2000-01-31', 'YYYY-MM-DD'), 'DD.MM.YYYY')
--
------------------------------------------------------------------------
Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...
Only self-confident people can be simple.
Další informace o konferenci Test