Skip to content

Commit

Permalink
Supplement _dtiso with _ltiso for local time
Browse files Browse the repository at this point in the history
add to mqttwarn.py
tdata['_ltiso']     = datetime.now().isoformat() #local time in iso format
Allows for local time in ISO format.
  • Loading branch information
jhalbrecht committed May 14, 2017
1 parent 9537e37 commit c63142a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mqttwarn.py
Expand Up @@ -741,6 +741,7 @@ def builtin_transform_data(topic, payload):
tdata['payload'] = payload
tdata['_dtepoch'] = int(time.time()) # 1392628581
tdata['_dtiso'] = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ") # 2014-02-17T10:38:43.910691Z
tdata['_ltiso'] = datetime.now().isoformat() #local time in iso format
tdata['_dthhmm'] = dt.strftime('%H:%M') # 10:16
tdata['_dthhmmss'] = dt.strftime('%H:%M:%S') # hhmmss=10:16:21

Expand Down

0 comments on commit c63142a

Please sign in to comment.