Hi Ted,

On 29/01/2011, at 5:19 AM, Theodore Petrosky wrote:

> How are people handling dates with no timezone (and no time, just the date 
> alone)? I really want to use the date column type and not care about the time 
> nor zone but I haven't figured out a way.

Here's the first post in a thread I started last August:

http://lists.apple.com/archives/webobjects-dev/2010/Aug/msg00132.html

Late in the thread, Henrique Prange provides a link to a sample project 
demonstrating how to use the Joda Time LocalDate class as a custom type in an 
EO model.  I have used Henrique's code, largely unmodified, backed by a 
PostgreSQL DATE column type in a deployed application since then.  It works as 
designed.

> I just got bitten with a timezone problem when shifting my app to a different 
> box. There must be a prescribed and easier way.

There's no prescribed way.  In that thread you'll find several other 
suggestions, some of which people are apparently using quite widely, and with 
success.  My personal preference is for genuine 1-day resolution types in both 
the database and the code.

As an aside, I gather you're using PostgreSQL from your posts in another 
thread.  If you're using full-blown timestamps elsewhere in your app (or if you 
choose one of the alternative solutions to your 1-day resolution problem that 
involves timestamps), be mindful of the "feature" in the PostgreSQL JDBC driver 
described in this thread:

http://lists.apple.com/archives/webobjects-dev/2010/Dec/msg00058.html

and the workarounds listed here:

http://wiki.objectstyle.org/confluence/display/WO/Project+WONDER-Frameworks-PostgresqlPlugin

in the yellow warning box entitled "JDBC driver adjusts timestamps".


-- 
Paul.

http://logicsquad.net/


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

This email sent to [email protected]

Reply via email to