Well it has been a while and I am not sure that this is the "best" way. But I think 
that what I did was to use the Date (the java.util version) object to get the current 
date and then use the getTime(). That gives you the milliseconds as a long which you 
can then use to pass into the Timestamp constructor.. 

What.. I think I can hear half the readers busting out laughing.. NOW STOP THAT :)  
really there might be a better way but I was in a rush and this does work..

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: RE: date format with OJB

Raymond,

How do you get the today date with Timestamp class?

Sylvain


-----Message d'origine-----
De: Raymond Lukas [mailto:[EMAIL PROTECTED]]
Date: vendredi, 17. janvier 2003 16:21
�: OJB Users List; Armin Waibel
Objet: RE: date format with OJB


Friend:

I am using the following and it works fine.. 

    private Integer userId;
    private Integer id;
    private Integer status;
    private java.sql.Timestamp tstamp;

I am able to store and retrieve these.

-----Original Message-----
From: Armin Waibel [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 9:29 AM
To: OJB Users List
Subject: Re: date format with OJB

Hi,

see docs shipped with OJB: JdbcTypes

DATE                  java.sql.Date
TIME                   java.sql.Time
TIMESTAMP      java.sql.Timestamp

regards,
Armin

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 17, 2003 12:12 PM
Subject: date format with OJB


Hello,

I'm using the datetime format for the date in my MS SQL database.

In the repository file I put the TIMESTAMP format as JDBC-type.

But which java format could I use in my class?
Timestamp?
Date?
DateFormat?
other?

Thank you
Sylvain

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to