views:

107

answers:

1

I'm trying to convert a date string from another application in Groovy. Something like "18-sep-2009 10:25:11 Romance Daylight Time"

It looks like Java does not understand the Romance as timezone alias. "18-sep-2009 10:25:11 Pacific Daylight Time" works fine.

Is there a fix for this other than parse the string and replace "Romance Daylight Time" with the something Java understands? If not, what should it be instead for Europe/Paris timezone?

+3  A: 

Try "Central European Time." That's the output of this short program:

import java.util.*;

public class Test
{    
    public static void main(String[] args)
    {
        TimeZone tz = TimeZone.getTimeZone("Europe/Paris");
        System.out.println(tz.getDisplayName());
    }
}

(I feel almost obliged to suggest using Joda Time, but I'm not sure there's enough evidence to suggest it in this case other than on general principle, so I'll just leave this parenthetical comment...)

Jon Skeet
this works. Thanks! will have to take a look at Joda soon as it has been recommended by number of people!
Berkay