Re: SQLPlus date formatting ?

From: Stephen Lappin <SL_at_rtel.demon.co.uk>
Date: Fri, 8 Jul 1994 10:03:51 +0000
Message-ID: <773661831snz_at_rtel.demon.co.uk>


In article <Roger_Walker.1g3f_at_CUEHere.Edmonton.AB.CA>

           Roger_Walker_at_CUEHere.Edmonton.AB.CA "C U E Here Sysop" writes:

>
> I have the following line in an SQL script file:
>
> select to_char(sysdate, 'fmYY MON DD HH24:MI') today from dual;
>
> It is from some sample code in one of the Intergraph Oracle documents. The
> problem is that the time "03:01" will show up as "3:1"; all leading zeros
> are lost. Is there a way to adjust my format string to get those missing
> zeros?
>

Try TO_CHAR(sysdate,'fmYY MON DD fmHH24:MI')

    or TO_CHAR(sysdate,'fmYY MON DD HH24fm:MI')

    FM is a 'fill mode' toggle. The first time it is used, it will suppress     leading/trailing spaces and leading zeroes. When used again, it turns off     the suppression.

--
Stephen Lappin

+-----------------+
| +-------------+ |  Real Time Engineering Ltd.
| |  Real Time  | |  Capital House
| +-------------+ |  20 Park Circus
| Engineering Ltd |  Glasgow G3 6BE         Tel: +44 (0)41 332 9400
+-----------------+  Scotland U.K.          Fax: +44 (0)41 331 2509
Received on Fri Jul 08 1994 - 12:03:51 CEST

Original text of this message