hi everyone.

since the days are getting longer, i noticed that in 2 months ill have an 
error with my getTime() Method, which gives me the current time in a "human 
friendly" way.

/**
**dd.mm.yyyy hh:mm:ss
**/
public static String getTimeAsStringTest(){
        Calendar cal = Calendar.getInstance();
        cal.setTimeZone(TimeZone.getTimeZone("Germany/Berlin"));
     
        int mod = 1; //Wintertime +1, Summertime +2

        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), 
cal.get(Calendar.DATE), cal.get(Calendar.HOUR_OF_DAY)+mod, 
cal.get(Calendar.MINUTE));
        DateFormat df = DateFormat.getDateTimeInstance( MEDIUM, MEDIUM, 
Locale.GERMANY );
        return df.format(cal.getTime());    
    }

i dont want to change the mod every 6 months (or how long the daylight 
saving time might be, i dont care^^).
i would prefer it very much if it would give me the correct time without 
adding 1 or 2 hours to the time the calendar gives me...

how do i archive this, without using something ugly like a list or some 42 
page long if else if statements which knows when to use +1 and when to use 
+2?...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/IWBzB3-VB4oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to