2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.airquality.internal.json;
15 import java.time.ZonedDateTime;
16 import java.time.format.DateTimeParseException;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import com.google.gson.annotations.SerializedName;
23 * The {@link AirQualityJsonTime} is responsible for storing
24 * the "time" node from the waqi.org JSON response
26 * @author Kuba Wolanin - Initial contribution
27 * @author Gaƫl L'hopital - Use ZonedDateTime instead of Calendar
30 public class AirQualityJsonTime {
33 private String dateString = "";
36 private String timeZone = "";
38 private String iso = "";
41 * Get observation time
43 * @return {ZonedDateTime}
45 public ZonedDateTime getObservationTime() throws DateTimeParseException {
46 return ZonedDateTime.parse(iso);