public static DateTimeType valueOf(String value) { return new DateTimeType(value); }
@Override public State calculate(Set<Item> items) { if (items != null && items.size() > 0) { ZonedDateTime max = null; for (Item item : items) { DateTimeType itemState = item.getStateAs(DateTimeType.class); if (itemState != null) { if (max == null || max.isAfter(itemState.getZonedDateTime())) { max = itemState.getZonedDateTime(); } } } if (max != null) { return new DateTimeType(max); } } return UnDefType.UNDEF; }
@Override public State calculate(Set<Item> items) { if (items != null && items.size() > 0) { ZonedDateTime max = null; for (Item item : items) { DateTimeType itemState = item.getStateAs(DateTimeType.class); if (itemState != null) { if (max == null || max.isBefore(itemState.getZonedDateTime())) { max = itemState.getZonedDateTime(); } } } if (max != null) { return new DateTimeType(max); } } return UnDefType.UNDEF; }
public static DateTimeType valueOf(String value) { return new DateTimeType(value); }
@Override protected DateTimeType convert(Instant value) { if (value == null) { return null; } Calendar calendar = GregorianCalendar.from(ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault())); return new DateTimeType(calendar); }
private ZonedDateTime convertTime(String sTime) { DateTimeType dateTime = new DateTimeType(sTime); return dateTime.getZonedDateTime(); }
@Override public void lastUpdatedChanged(Instant lastActivity) { Calendar calendar = GregorianCalendar.from(ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault())); updateState(BluetoothBindingConstants.CHANNEL_LAST_UPDATED, new DateTimeType(calendar)); }
result = new PercentType(type.toString()); } else if (typeClass.equals(org.openhab.core.library.types.DateTimeType.class)) { result = new DateTimeType(cloneCalendar(type)); } else if (typeClass.equals(org.openhab.core.library.types.PointType.class)) { result = new PointType(type.toString());
@Override public State calculate(Set<Item> items) { if (items != null && items.size() > 0) { ZonedDateTime max = null; for (Item item : items) { DateTimeType itemState = item.getStateAs(DateTimeType.class); if (itemState != null) { if (max == null || max.isAfter(itemState.getZonedDateTime())) { max = itemState.getZonedDateTime(); } } } if (max != null) { return new DateTimeType(max); } } return UnDefType.UNDEF; }
@Override public State calculate(Set<Item> items) { if (items != null && items.size() > 0) { ZonedDateTime max = null; for (Item item : items) { DateTimeType itemState = item.getStateAs(DateTimeType.class); if (itemState != null) { if (max == null || max.isBefore(itemState.getZonedDateTime())) { max = itemState.getZonedDateTime(); } } } if (max != null) { return new DateTimeType(max); } } return UnDefType.UNDEF; }