Skip to content

Commit

Permalink
Fixed location.timeZone and changed format
Browse files Browse the repository at this point in the history
  • Loading branch information
ronvandegraaf authored Jan 18, 2018
1 parent eb96771 commit 113524c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parse(String description) {
log.debug "${device.displayName}: Parsing '${description}'"
}
// send event for heartbeat
def now = new Date().format("yyyy MMM dd EEE h:mm:ss a", ${(location.timeZone != null) ? location.timeZone : TimeZone.getTimeZone("UTC")})
def now = new Date().format("EEE dd MMM yyyy h:mm:ss a", location.timeZone)
def nowDate = new Date(now).getTime()
sendEvent(name: "lastCheckin", value: now)
sendEvent(name: "lastCheckinDate", value: nowDate)
Expand Down Expand Up @@ -294,6 +294,6 @@ private Map getContactResult(value) {
}

def resetBatteryRuntime() {
def now = new Date().format("yyyy MMM dd EEE h:mm:ss a", ${(location.timeZone != null) ? location.timeZone : TimeZone.getTimeZone("UTC")})
def now = new Date().format("dd MMM yyyy", location.timeZone)
sendEvent(name: "batteryRuntime", value: now)
}

0 comments on commit 113524c

Please sign in to comment.