List of usage examples for org.joda.time.tz CachedDateTimeZone forZone
public static CachedDateTimeZone forZone(DateTimeZone zone)
From source file:org.opentestsystem.delivery.Sb11TimeZoneBuilder.java
License:Open Source License
public Sb11TimeZoneBuilder(final String timeZone) { cachedDateTimeZone = CachedDateTimeZone.forZone(DateTimeZone.forID(timeZone)); }
From source file:org.opentestsystem.delivery.Sb11TimeZoneBuilder.java
License:Open Source License
@PostConstruct public void init() { //default to 'user' timezone which would be local server time, which gets replaced with the client's configured TZ if found. cachedDateTimeZone = CachedDateTimeZone.forZone(DateTimeZone.forID(System.getProperty("user.timezone"))); List<ClientEntity> clientEntityList = entityService.findAll(ClientEntity.FORMAT_TYPE); if (clientEntityList != null && !clientEntityList.isEmpty()) { ClientEntity clientEntity = clientEntityList.get(0); if (clientEntity.getTimeZone() != null && !clientEntity.getTimeZone().isEmpty()) { if (!DateTimeZone.getAvailableIDs().contains(clientEntity.getTimeZone())) { LOGGER.error("misconfiguration (invalid timezone id): " + clientEntity.getTimeZone()); } else { cachedDateTimeZone = CachedDateTimeZone.forZone(DateTimeZone.forID(clientEntity.getTimeZone())); }//from ww w.j a v a 2 s. c o m } } }