Browse Source

Fix filename timestamps

tags/nilmtools-0.1
Jim Paris 11 years ago
parent
commit
fc6b2dfa5e
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      insert.py

+ 4
- 1
insert.py View File

@@ -66,7 +66,10 @@ with client.stream_insert_context(args.path) as stream:

# Try to get a real timestamp from the filename
try:
clock_ts = parse_time(filename).totimestamp()
# Subtract 1 hour because files are created at the end of the hour.
# Hopefully, we'll be able to use internal comments and this value
# won't matter anyway.
clock_ts = parse_time(filename).totimestamp() - 3600
printf("Clock time updated to %s\n", format_time(clock_ts))
except ValueError:
pass


Loading…
Cancel
Save