Re: Date Formatting
От | Richard A Lough |
---|---|
Тема | Re: Date Formatting |
Дата | |
Msg-id | 3CD6EA0E.55D7549D@dnet.co.uk обсуждение исходный текст |
Ответ на | Re: Date Formatting (Doug Silver <dsilver@urchin.com>) |
Ответы |
Time Formatting
|
Список | pgsql-novice |
Doug Silver wrote: > > Hi Tom - > > select cast (now() as date) as date; > date > ------------ > 2002-05-03 > > Depending on your application (e.g. perl/php script), that output is easy > enough change it around to what you want or you could certainly write a > function to do it -- something I have yet to do! I think such a function > would be fairly easy to do since you're just rearranging the > output, but doesn't everything look easy at the outset? You didn't > mention the context of what you need this for, so there are lots of ways > to do this. > > -doug > > On Fri, 3 May 2002, Tom Ansley wrote: > > > I am writing timestamps to file and the formatting is currently 2002-06-06 > > 00:00:00.0. Is there a function to only write the date and also to format it > > something like MM/dd/yyyy ? > > SET DATESTYLE 'Postgres, US'; might get you part of the way there. You might need to manipulate the output using sed/awk/Perl to get exactly what you want To get back to the default use 'ISO' or 'European' depending on where you started from. HTH Richard A Lough
В списке pgsql-novice по дате отправления: