Dates in Java

2001-04-06 Thread Ryan
I have a simple question about the Date object (or similar object)   I have a mySQL table with a DATETIME cell. I want to get the date from this cell   (formatted like so: e.g.  2001-03-23 13:04:59)    and retrieve the date that is exactly 7 days earlier than the retrieved date.   What is th

RE: Dates in Java

2001-04-06 Thread Michael Wentzel
I have a simple question about the Date object (or similar object) I have a mySQL table with a DATETIME cell. I want to get the date from this cell (formatted like so: e.g. 2001-03-23 13:04:59) and retrieve the date that is exactly 7 days earlier than the retrieved date. What is the easi

RE: Dates in Java

2001-04-06 Thread Erik Barke
nt: den 6 april 2001 14:18To: [EMAIL PROTECTED]Subject: Dates in Java I have a simple question about the Date object (or similar object)   I have a mySQL table with a DATETIME cell. I want to get the date from this cell   (formatted like so: e.g.  2001-03-23 13:04:59)    a

RE: Dates in Java

2001-04-06 Thread Alistair Hopkins
try "select myDate - 7 from myTable;" in your SQL statement for a quick fix :-) (works on postgres, don't know about msql) -Original Message- From: Michael Wentzel [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 12:58 PM To: '[EMAIL PROTECTED]' Subject: R

RE: Dates in Java

2001-04-06 Thread Arnaud Vandyck
On Fri, 6 Apr 2001, Michael Wentzel wrote: tc> For example, tc> DateTest.java:20: cannot resolve symbol tc> symbol : constructor Date () tc> location: class java.sql.Date tc> Date d = new Date(); tc> ^ You got to explicitly tell which Date object you w

Re: Dates in Java

2001-04-06 Thread Scott Walter
This is the way I would do it, which will allow it be portable to any database. Calendar c = Calendar.getInstance(); c.add(Calendar.DATE,-7); //Connection is assumed PreparedStatement stmt = conn.prepareStatement("select * from sometable where somedatetimefield = ?"); stmt.setTimestamp(1,new Ti

Re: Dates in Java

2001-04-06 Thread Stéphane BAUDET
:-) > (works on postgres, don't know about msql) > > -Original Message- > From: Michael Wentzel [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 12:58 PM > To: '[EMAIL PROTECTED]' > Subject: RE: Dates in Java > > I have a simple question a

Re: Dates in Java

2001-04-06 Thread Martin Mauri
t; > > > try "select myDate - 7 from myTable;" in your SQL statement for a quick fix > > :-) > > (works on postgres, don't know about msql) > > > > -Original Message- > > From: Michael Wentzel [mailto:[EMAIL PROTECTED]] > > Sent:

Re: Dates in Java

2001-04-06 Thread Joe Laffey
On Fri, 6 Apr 2001, Ryan wrote: > I have a simple question about the Date object (or similar object) > > I have a mySQL table with a DATETIME cell. I want to get the date from this cell > > (formatted like so: e.g. 2001-03-23 13:04:59) > > and retrieve the date that is exactly 7 days earlier th

Re: Dates in Java

2001-04-06 Thread Milt Epstein
t for a quick > fix > > > :-) > > > (works on postgres, don't know about msql) > > > > > > -Original Message- > > > From: Michael Wentzel [mailto:[EMAIL PROTECTED]] > > > Sent: Friday, April 06, 2001 12:58 PM > > > To: '[EMAIL PROTECTE

Re: Dates in Java

2001-04-06 Thread Jeff Kilbride
Responses like this scare new programmers off the lists. I remember my first post... --jeff - Original Message - From: "Milt Epstein" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 06, 2001 7:05 AM Subject: Re: Dates in Java > On Fri, 6 Apr 2001

Re: Dates in Java

2001-04-06 Thread Alvin Yap
gt; > To: <[EMAIL PROTECTED]> > Sent: Friday, April 06, 2001 7:05 AM > Subject: Re: Dates in Java > > > On Fri, 6 Apr 2001, Martin Mauri wrote: > > > > > Hey...don't be so rude, let the boys work their problems out... > > > > There is somethin

Re: Dates in Java

2001-04-06 Thread Milt Epstein
useful and friendly) since I joined, so this probably isn't something to be concerned about (on either side). > - Original Message - > From: "Milt Epstein" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, April 06, 2001 7:05 AM > Subject: Re

Re: Dates in Java

2001-04-06 Thread Martin Mauri
something to be > concerned about (on either side). > > > > ----- Original Message - > > From: "Milt Epstein" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, April 06, 2001 7:05 AM > > Subject: Re: Dates in Java >

RE: Scope of Mailing List (was RE: Dates in Java)

2001-04-06 Thread Michael Wentzel
> Are we in the tomcat-user forum ??? > I don't see the relationship between a so simple constructor problem > (which Javadoc solve quiet easily ...) and Tomcat ... I agree that this list is not the place for this question(the proper place would be java.sun.com JDC groups) but most of the time i