Get TimeZone for 'Europe/Paris' in Java

Description

The following code shows how to get TimeZone for 'Europe/Paris'.

Example


/*from   ww  w  .  jav  a 2s.  c  om*/
import java.util.Calendar;
import java.util.TimeZone;

public class Main {

  public static void main(String[] args) {
    Calendar calParis = Calendar.getInstance();

    calParis.setTimeZone(TimeZone.getTimeZone("Europe/Paris"));
    System.out.println("Time in Paris: " + calParis.get(Calendar.HOUR_OF_DAY) + ":"
        + calParis.get(Calendar.MINUTE));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone