• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to use dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use dates


  • Subject: Re: How to use dates
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 13 May 2011 22:37:43 -0700

Hi Daniel,

If you just want the date, and not the time, then JodaTime is probably better for you to use.  Search the list archives for details.

The problem with Java timestamps is that they are very accurate and include things like Daylight Saving time and historical changes in time.  This is good for some purposes, but not when all you care about is the date.  You can work around this with Java timestamps by setting the time to 12:00 noon when you create the date.  This will work as long as your app is not used across more than 11 hours of time zones.  You can set the time with a formatter or in the setDate...  methods of your EO.


Chuck


On 2011-05-13, at 4:48 PM, Daniel Mejia wrote:

> Hi there,
>
> I need help with a problem with the Date type.
>
> The problem happens when I type de date 1920-dec-31in a field defined as date in a edit page of Modern D2W application. After saving the page the date is displayed as 1920-dec-30. The same happens for all the years before 1921, but for years after 1921 I get the correct date after saving the page.
>
> In the database, the column is defined as DATE in MySQL.
> In the modeller it is defined using the prototype "date", DataType:Date, External Type: DATE, Class: com.webobjects.foundation.NSTimeststamp.
>
> What I'm doing wrong with the use of date type?. I only need to store dates up to 1880.
>
> I'm using :
> WO 5.4
> Modern Direct to web,
> MySQL and Project Wonder.
>
> Regards,
>
> Daniel.

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to use dates
      • From: Daniel Mejia <email@hidden>
    • Re: How to use dates
      • From: Paul Hoadley <email@hidden>
References: 
 >How to use dates (From: Daniel Mejia <email@hidden>)

  • Prev by Date: How to use dates
  • Next by Date: Re: How to use dates
  • Previous by thread: How to use dates
  • Next by thread: Re: How to use dates
  • Index(es):
    • Date
    • Thread