Just a short addition to this thread,
I'm trying to use this formatter (to get a valid date declaration for an RSS (RDF) feed): NSTimestampFormatter dateTimeFormatter = new NSTimestampFormatter( "% Y-%m-%dT%H:%M%z", new DateFormatSymbols( Locale.ENGLISH ) );

But I get an exception because the %z
In fact the NSTimestamp is GMT, when I print it I get:
2005-10-25 08:28:05 Etc/GMT

Reading the documentation, it says it would default to the local system timezone, but the null pointer exception make me think it doesn't.

Can I set a default timezone for the application using: setDefaultTimeZone in the application constructor? if it's the correct way to handle that...

Thanks

Xavier



I'm downloading it right now:)
Thanks Hugi




If you want to program WO, you really do want to know Java well. Take a day off and read through Bruce Eckel's "Thinking in Java". It's free and your life will be a simpler and happier one :-).

You can grab a copy here:
http://www.pythoncriticalmass.com/

Cheers,
- Hugi


On 27.10.2005, at 15:05, Dev WO wrote:



Hi,
I'm actually looking to generate a string containing different "parts", so I have to generate the string in code and bind the method to a WOString in WOBuilder.
But I'm having issue using NSTimestampFormatter directly in code.

Searching for the correct way to use it, I found a post but it doesn't seem to work...

Here's what I have:
        public String stringToDisplay() {
NSTimestampFormatter dateTimeFormatter = new NSTimestampFormatter( "%A %e %B %Y", new DateFormatSymbols ( Locale.FRENCH ) ); return item.title() + dateTimeFormatter.parseObject (item.dateAndTime().toString());
        }

And it gave me:
Main.java:144: unreported exception java.text.ParseException; must be caught or declared to be thrown

So I know I have to caught/declare the exception, but I'm still figuring how to do it:(

Anyhow I didn't found documentation on how to use NSTimestampFormatter in code...

Xavier
_______________________________________________
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/hugi% 40vefsyn.is

This email sent to [EMAIL PROTECTED]








_______________________________________________
WebObjects-dev mailing list
[EMAIL PROTECTED]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev



_______________________________________________
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