Depends on whether you need the time zone or not.  

Let's say you want to say Walmart's black friday sale begins at 12 am on the 
Friday after Thanksgiving. You'd model that as a LocalDateTime because it's a 
date and time that is not specific to any time zone.  East coast stores start 
their sale 3 hours earlier than west coast stores because of the time zone 
difference.

Similar for birthdate, but that's typically represented as LocalDate instead.  
You'd use LocalTime to model something like tea time or happy hour at the pub :D

DateTime or NSTimestamp are the only ones that use timezones. If you need a 
global time stamp to indicate when an event occurs, then you'd go with one of 
these.  The NYSE opens at 9am Eastern time this morning. If you're in 
California, it doesn't wait three hours for you to wake up :-)

Ramsey


On Jun 12, 2012, at 8:28 AM, Paul Yu wrote:

> When we model a new EOModel is the recommendation to use jodaLocalDateTime??? 
> or it depends?  
> 
> -- 
> Paul Yu
> Sent with Sparrow
> 
> On Tuesday, June 12, 2012 at 11:08 AM, Ramsey Gurley wrote:
> 
>> The component I'm using isn't in wonder. Have a look at R2D2WEditDate.
>> 
>> https://github.com/nullterminated/ponder/tree/master/ERR2d2w
>> 
>> Ramsey
>> 
>> On Jun 12, 2012, at 4:18 AM, Paul Hoadley wrote:
>> 
>>> Hello,
>>> 
>>> Back in December 2011, in this thread:
>>> 
>>> http://lists.apple.com/archives/webobjects-dev/2011/Dec/msg00440.html
>>> 
>>> Ramsey described a method for binding an ERXJodaLocalTimeFormatter to (I 
>>> assume) an ERD2WEditString component with this rule:
>>> 
>>>> 10 : ((smartAttribute.valueFactoryMethod != null and 
>>>> smartAttribute.factoryMethodArgumentType = 3) and smartAttribute.className 
>>>> = 'org.joda.time.LocalTime') => formatObject = {"arguments" = 
>>>> ({"className" = "java.lang.String"; "contextKey" = "formatter"; }, 
>>>> {"className" = "java.util.Locale"; "contextKey" = 
>>>> "session.localizer.@locale"; }, {"className" = "java.util.TimeZone"; 
>>>> "contextKey" = "session.timeZone"; }); "className" = 
>>>> "er.extensions.formatters.ERXJodaLocalTimeFormatter"; } 
>>>> [ERDDelayedObjectCreationAssignment]
>>> 
>>> Firstly, is that still the state of the art, or is there a better way to do 
>>> it now? Secondly, Ramsey, should that work just as well substituting 
>>> 'org.joda.time.LocalDate' and 
>>> 'er.extensions.formatters.ERXJodaLocalDateFormatter' above? Both questions 
>>> arise because that's what I've tried, and I cannot get it to work for the 
>>> life of me. Specifically, I have these rules:
>>> 
>>> 100 : (entity.name = 'Invoice' and propertyKey = 'invoiceDate') => 
>>> componentName = "ERD2WEditString" [com.webobjects.directtoweb.Assignment]
>>> 
>>> 50 : ((smartAttribute.valueFactoryMethod != null and 
>>> smartAttribute.factoryMethodArgumentType = 3) and smartAttribute.className 
>>> = 'org.joda.time.LocalDate') => formatObject = {"arguments" = ({"className" 
>>> = "java.lang.String"; "contextKey" = "formatter"; }, {"className" = 
>>> "java.util.Locale"; "contextKey" = "session.localizer.@locale"; }, 
>>> {"className" = "java.util.TimeZone"; "contextKey" = "session.timeZone"; }); 
>>> "className" = "er.extensions.formatters.ERXJodaLocalDateFormatter"; } 
>>> [ERDDelayedObjectCreationAssigment]
>>> 
>>> 100 : (entity.name = 'Invoice' and propertyKey = 'invoiceDate') => 
>>> formatter = "d2wContext.formatObject" 
>>> [com.webobjects.directtoweb.Assignment]
>>> 
>>> Yet there's no 'formatter' binding when I hover over the invoiceDate field, 
>>> and I continue to get an exception complaining about not having a formatter.
>>> 
>>> 
>>> --
>>> Paul Hoadley
>>> 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:
>>> https://lists.apple.com/mailman/options/webobjects-dev/ramseygurley%40gmail.com
>>> 
>>> This email sent to [email protected]
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/pyu%40mac.com
>> 
>> This email sent to [email protected]
> 

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

This email sent to [email protected]

Reply via email to