From 79938dcab450e659e30342a34452fcf42d982c1e Mon Sep 17 00:00:00 2001 From: storm64 Date: Mon, 23 May 2022 16:20:23 +0200 Subject: [PATCH] [sleeplog] Update README.md Correct timestamp information --- apps/sleeplog/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/sleeplog/README.md b/apps/sleeplog/README.md index f083bc3e4..9f0e6a44f 100644 --- a/apps/sleeplog/README.md +++ b/apps/sleeplog/README.md @@ -38,27 +38,27 @@ But here are some explanations how to use the app and settings: - display log is not implemented yet - options `Enable` and `write File` should be self explaining - the `Duration` specifies how long data should be written into the .csv file - - the .csv file loggs the following data (timestamps are in days since 30.12.1899 as used by office software): + - the .csv file loggs the following data (timestamps are in days since 1900-01-01 00:00 UTC as used by office software): _timestamp, movement, status, consecutive, asleepSince, awakeSince, bpm, bpmConfidence_ - __Timestamps and files:__ - 1. externally visible/usable timestamps (in `global.sleeplog`) are formatted as UNIX timestamps: + 1. externally visible/usable timestamps (in `global.sleeplog`) are formatted as Bangle timestamps: seconds since 1970-01-01 00:00 UTC 2. internally used and logged (to `sleeplog.log (StorageFile)`) is within the highest available resolution: - 10 minutes since 1970-01-01 00:00 UTC (`UNIX / (10 * 60 * 1000)`) + 10 minutes since 1970-01-01 00:00 UTC (`Bangle / (10 * 60 * 1000)`) 3. debug .csv file ID (`sleeplog_123456.csv`) has a hourly resolution: - hours since 1970-01-01 00:00 UTC (`UNIX / (60 * 60 * 1000)`) + hours since 1970-01-01 00:00 UTC (`Bangle / (60 * 60 * 1000)`) 4. logged timestamps inside the debug .csv file are formatted for office calculation software: - days since 1899-12-30 00:00 UTC (`UNIX / (24 * 60 * 60 * 1000) + 25569`) + days since 1900-01-01 00:00 UTC (`Bangle / (24 * 60 * 60 * 1000) + 25569`) 5. every 14 days the `sleeplog.log (StorageFile)` is reduced and old entries are moved into separat files for each fortnight (`sleeplog_1234.log`) but still accessible though the app: - fortnights since 1970-01-04 12:00 UTC (converted with `require("sleeplog").msToFn(UNIX)` and `require("sleeplog").fnToMs(fortnight)`) + fortnights since 1970-01-04 12:00 UTC (converted with `require("sleeplog").msToFn(Bangle)` and `require("sleeplog").fnToMs(fortnight)`) - __Logfiles from before 0.10:__ timestamps and sleeping status of old logfiles are automatically converted on your first consecutive sleep or manually by `require("sleeplog").convertOldLog()` - __View logged data:__ if you'd like to view your logged data in the IDE, you can access it with `require("sleeplog").printLog(since, until)` or `require("sleeplog").readLog(since, until)` to view the raw data - since & until in UNIX timestamp, e.g. `require("sleeplog").printLog(Date()-24*60*60*1000, Date())` for the last 24h + since & until in Bangle timestamp, e.g. `require("sleeplog").printLog(Date()-24*60*60*1000, Date())` for the last 24h --- @@ -80,7 +80,6 @@ Temporarily removed logfiles from metadata.json to prevent removal on un-/reinst * Add display debugging log functionality. * Add custom interface.html to view, down- and upload logged data via App Loader. * Send the logged information to Gadgetbridge. - ___(For now I have no idea how to achieve this, help is appreciated.)___ #### Requests, Bugs and Feedback Please leave requests and bug reports by raising an issue at [github.com/storm64/BangleApps](https://github.com/storm64/BangleApps) (or send me a [mail](mailto:banglejs@storm64.de)).