Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Date Functions
Lee Fesperman <firstsql_at_ix.netcom.com> wrote in message news:<3E5152FB.4285_at_ix.netcom.com>...
> Robert Klemme wrote:
> >
> > "Lee Fesperman" <firstsql_at_ix.netcom.com> schrieb im Newsbeitrag
> > news:3E509498.475D_at_ix.netcom.com..
> > > --B wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have a date column having value like '1/1/1900 2:30:00 PM'.
> > > > Is there an easy way to get time in 24hr scale using some functions,
> for
> > > > above example it should return '14:30'?
> > >
> > > For Java 'methods', check java.text.SimpleDateFormat.
> >
> > That's for printing. To directly access the value use a Calendar.
>
> ??? And what method in Calendar will return '14:30'?
If you use jdbc, there was a bug there. It didn't receive date
properly, you needed to do it in 2 pieces, date and time separately.
I don't know if a bug was fixed lately. Anyway, you don't exactly
need a calendar. jdbc uses java.sql.date class for dates, and you can
get components directly from this class, using methods getHours,
getMinutes and getSeconds.
If it's too complex for you, consider, like D.A. Morgan suggests,
using to_char function in your query.
Received on Tue Feb 18 2003 - 11:13:58 CST