home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,990 of 2,288   
   Spare Brain to Joe Weinstein   
   Re: Can you help me with JDBC getDate()    
   01 Feb 05 22:03:58   
   
   XPost: comp.databases.oracle.misc, comp.databases.oracle.server,   
   comp.lang.java.databases   
   From: spare_brain@yahoo.com   
      
   "Joe Weinstein"  wrote in message   
   news:42003788.1050606@bea.com...   
   >   
   >   
   > Spare Brain wrote:   
   >   
   > > Hi,   
   > >   
   > > I am observing a strange error with the time portion of the   
   java.sql.Date()   
   > > when using resultSet.getDate() - it always seems to show 12:00:00.   
   > >   
   > > The following code prints 2004-10-27 11:00:00.0   
   > >   
   > >   String dtStr = resultset.getString("PROMISEDATE");   
   > >   System.out.println(dtStr);   
   > >   
   > > The following code prints 2004-10-27 12:00:00   
   > >   java.util.Date dt = resultset.getDate("PROMISEDATE");   
   > >   System.out.println(new SimpleDateFormat("yyyy-MM-dd   
   > > hh:mm:ss").format(dt));   
   > >   
   > > Any clue why the getDate screws up the time? Any remedies you may   
   suggest?   
   >   
   > Yes, because it's a Date (date only). Try getTimestamp().   
   > Joe Weinstein at BEA   
   >   
   >   
   > >   
   > > Many thanks   
   > > SB   
   > >   
   > >   
   > >   
   >   
      
   That worked!!! Thanks Joe.   
   SB   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca