Date: Can you have one that is just mm/dd or mm/yyyy etc?



I need to store some data in this format: "mm/yyyy" as a Date or
DateTime. I can create SimpleDateFormat("mm/yyyy"), but when I do
format.parse() on "12/2001" it helpfully returns "December 1, 2001". I
need to store it as a DateTime of December 2001. Storing it as a String
is not an option.

Has anyone dealt with this kind of situation before and could point me
in the right direction to understand how to handle this?

Thanks,
Libby

.



Relevant Pages

  • Re: Can you have one that is just mm/dd or mm/yyyy etc?
    ... need to store it as a DateTime of December 2001. ... Why is storing the date as a String not an option? ... Another way to go would be store an arbitrary day with your month and year ...
    (comp.lang.java.programmer)
  • Re: MS SQL getDate() Function remove Time
    ... I strongly suggest not storing a date column as a string. ... Hi I am storing the coumn as datetime and not string. ... ....It should overwrite rowOld with rowNew, not insert rowNew as a new ...
    (comp.databases.ms-sqlserver)
  • Re: TextBox Validation for time only, not date
    ... A DateTime value is any point in time. ... To store a time only, the TimeSpan type should be used. ... String, but note that it expects a fixed format and disregards ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Time zone
    ... Always get, set, calc, and store only UTC ... Your client side ... can easily convert to/from UTC so they can display local times. ... change their time zone when they travel and still get and use the datetime ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: set birth date column format??
    ... If you want store only a date you could use a smalldatetime field. ... Yes, it was turned to a datetime field, I am looking at it with SSMS ...
    (microsoft.public.sqlserver)