TO_DATE and single digit months driving me nuts...

From: Philip Hallstrom <philip(at)adhesivemedia(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: TO_DATE and single digit months driving me nuts...
Date: 2000-05-24 00:35:28
Message-ID: 200005240100.SAA74006@illiad.adhesivemedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi -
I'm playing around with inserting dates into a timestamp field and
am getting annoyed at single digit dates/days/hours/minutes.
The problem is that I have something like:
TO_TIMESTAMP('2000 5 25 09 30', 'YYYY MM DD HH24 MI')
which fails because it expects the month to be "05" instead of "5". Other
than pad all these myself in my code, is there some way to tell the
formatter to allow for missing leading zeros? Something similar to the
"fm" format option, but a bit different...
Thanks!
-philip

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2000-05-24 01:19:59 Re: quick (and probably dumb) question
Previous Message Chris Bitmead 2000-05-23 23:55:10 Re: [GENERAL] Re: Postgresql OO Patch