Skip to content

Commit

Permalink
[metOfficeDataHub] Initial Commit for v4 updates
Browse files Browse the repository at this point in the history
[metOfficeDataHub] Initial code commit updates.

Signed-off-by: David Goodyear <[email protected]>
  • Loading branch information
dag81 committed Aug 4, 2023
1 parent c5f89c7 commit b368b77
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,15 @@ public void channelUnlinked(ChannelUID channelUID) {
public static String getLastHour() {
long timeRoundedToLastHour = System.currentTimeMillis();
timeRoundedToLastHour -= timeRoundedToLastHour % 3600000;
Date date = new Date(timeRoundedToLastHour);
Instant instant = date.toInstant();
// DAG: MUST FIX THIS CODE TO BE MORE SYSTAMATIC
final Instant instant = new Date(timeRoundedToLastHour).toInstant();
return instant.toString().substring(0, 16) + "Z";

// private static final String PATTERN_FORMAT = "YYYY-mm-DD'T'HH:mm'Z'";
}

public static String getStartOfDay() {
long timeRoundedToLastHour = System.currentTimeMillis();
timeRoundedToLastHour -= timeRoundedToLastHour % 86400000;
Date date = new Date(timeRoundedToLastHour);
Instant instant = date.toInstant();
// DAG: MUST FIX THIS CODE TO BE MORE SYSTAMATIC
long timeRoundedToDayStart = System.currentTimeMillis();
timeRoundedToDayStart -= timeRoundedToDayStart % 86400000;
final Instant instant = new Date(timeRoundedToDayStart).toInstant();
return instant.toString().substring(0, 16) + "Z";

// private static final String PATTERN_FORMAT = "YYYY-mm-DD'T'HH:mm'Z'";
}

public void pollForDataHourlyData(String responseContent) {
Expand Down

0 comments on commit b368b77

Please sign in to comment.