Thank you Chuck,

As you suggested, I modified the setDate method to set the time to the 12:00 
noon and set the server Time Zone to Mexico/General and now the dates are 
displayed correctly.

Thank you very  much Chuck,

Daniel.




On 14/05/2011, at 00:37, Chuck Hill wrote:

> 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
> 
> 
> 
> 
> 
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to