Re: conver Date to long

From: Jim Kennedy <kennedy-family_at_home.com>
Date: Wed, 14 Nov 2001 15:55:40 GMT
Message-ID: <0uwI7.25821$XJ4.15971619_at_news1.sttln1.wa.home.com>


Long what? Dates are dates and long is a number. You are trying to compare quarts and years (one a unit of volume and one a unit of time -makes no sense)
If you want the number of seconds from a particular time then you can write a function. To do that I would convert the constant date to Julian, the new date to Julian subtract and multiply to convert from days to seconds. Since Oracle's date data type goes down to the second, the fractions will work out correctly.

Jim
"zuth" <tzhong_at_163.net> wrote in message news:c8c3eca3.0111140711.400dccff_at_posting.google.com...
> Thanks. I tried but it only return 7 digits, like '2452227'. However,
> I want the long, like '1003441232000'.
>
> tz
>
>
> "Jim Kennedy" <kennedy-family_at_home.com> wrote in message
 news:<zonI7.24196$XJ4.15020859_at_news1.sttln1.wa.home.com>...
> > Do you want a Julian representation of a date? I hope so otherwise date
 to
> > long makes no sense.
> > select to_char(my_date,'J') from tbl;
> >
> > Jim
> > "zuth" <tzhong_at_163.net> wrote in message
> > news:c8c3eca3.0111131915.412b87a_at_posting.google.com...
> > > How to conver Date to long?
> > >
> > > I use 'select my_date from tbl;', it reply such as'11-Nov-01'.
> > > However, I want it reply long, like '12345678901...'
> > >
> > > And, if I use JDBC, how can I get the long from Date? I searched Class
> > > Java.sql.Date but can not find the proper answer.
> > >
> > > thanks,
> > > tz
Received on Wed Nov 14 2001 - 16:55:40 CET

Original text of this message