NSTimestampFormatter and the GMT offset
NSTimestampFormatter and the GMT offset
- Subject: NSTimestampFormatter and the GMT offset
- From: Pascal Robert <email@hidden>
- Date: Tue, 30 Mar 2010 13:27:28 -0400
I need to send dates from a Dojo app to an ERRest service. Dates constructed by Dojo are like this : 2010-03-30T11:44:34-04:00
er.rest.timestampFormat = %Y-%m-%dT%H:%M:%S%z
But I keep getting :
Caused by: java.lang.IllegalArgumentException: Failed to parse '2010-03-30T11:44:34-04:00' as a timestamp (example: 2010-03-30T11:45:00Z). at er.rest.ERXRestUtils.coerceValueToTypeNamed(ERXRestUtils.java:196) at er.rest.ERXRestUtils.coerceValueToAttributeType(ERXRestUtils.java:279) ... 15 more Caused by: java.text.ParseException: Format.parseObject(String) failed at java.text.Format.parseObject(Format.java:221) at er.rest.ERXRestUtils.coerceValueToTypeNamed(ERXRestUtils.java:187) ... 16 more
And it look like the problem is with the "%z" string, if I don't use the GMT offset (so the string ends with "Z" instead of "-04:00"), I don't have this problem. Problem is, I really need the offset. I searched the list and it look like it's a bug with NSTimestampFormatter. I guess one of the solutions would be to use java.util.Date instead of NSTimestamp, but anyone have a better solution? ----
Pascal Robert
AIM: MacTICanada Twitter : MacTICanada |
_______________________________________________
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