Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 17:46:31 GMT
"LibbyChantel" <LibbyChantel@xxxxxxxxx> wrote in message news:1146065213.847047.119090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You guys are totally missing the point.
I'm not totally following either.
My question is not how to
format a date to use it in SQL, which is why I left that information
out originally. My question was, is there a way to save only a portion
of a date in a Date object?
No, there isn't.
My solution is to extend the Date Object and add a field to it which
denotes whether the entire date is valid, or just some combination of
mm/yyyy, etc But I thought maybe there was a way to use the original
Date object without "enhancing" it. I am REQUIRED to store the date in
a Date, even if it is invalid : )
Careful the way you phrase this. You say you're "required to store the date in a Date", but might your requirements be "store the date", without regards of the actual class where the Date is stored?
If you really do need to use the Date object, you're out of luck. The date object simply doesn't support what you want. Even if you extend the Date object to add functionalities, when you pass that Date object to an SQL database, the database isn't going to know about your extended functionalities, and will simply store Dates the way it always has.
You should probably go a level higher in abstraction, and describe what you're trying to do, rather than describe how you want to do it.
- Oliver
.
- Follow-Ups:
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: Roedy Green
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- References:
- Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: LibbyChantel
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: Thomas Weidenfeller
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: LibbyChantel
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: Thomas Weidenfeller
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: LibbyChantel
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: Bjorn Abelli
- Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- From: LibbyChantel
- Date: Can you have one that is just mm/dd or mm/yyyy etc?
- Prev by Date: weird serialization issue with long
- Next by Date: instanceOf operator new bie question
- Previous by thread: Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- Next by thread: Re: Date: Can you have one that is just mm/dd or mm/yyyy etc?
- Index(es):
Relevant Pages
|