List of usage examples for org.joda.time DateTimeZone getOffsetFromLocal
public int getOffsetFromLocal(long instantLocal)
From source file:com.enonic.cms.business.timezone.TimeZoneXmlCreator.java
License:Open Source License
private Element doCreateTimeZoneElement(DateTimeZone timeZone) { Element timeZoneEl = new Element("time-zone"); timeZoneEl.setAttribute("ID", timeZone.getID()); timeZoneEl.addContent(new Element("display-name").setText(timeZone.getID())); DateTime localTime = now.plus(timeZone.getOffsetFromLocal(now.getMillis())); Period offsetPeriod = new Period(now, localTime); //timeZoneEl.addContent( new Element( "hours-from-utc" ).setText( String.valueOf( offsetPeriod.getHours() ) ) ); timeZoneEl.addContent(// w ww.j av a 2s .c o m new Element("hours-from-utc-as-human-readable").setText(getHoursAsHumanReadable(offsetPeriod))); return timeZoneEl; }