Code example for TimeZone

Methods: getOffset

  public DateTime(Date value, TimeZone zone) {
    this.value = value.getTime();
    this.tzShift = zone.getOffset(value.getTime()) / 60000;
  public static DateTime now() { 
    return new DateTime(new Date(), GMT);
   * Date/time value expressed as the number of ms since the Unix epoch. 
   * If the time zone is specified, this value is normalized to UTC, so 
   * to format this date/time value, the time zone shift has to be applied. 
Experience pair programming with AI  Get Codota for Java