LoRaWanGateway
LoRaWanGateway copied to clipboard
add localization to the time stamps
By adding CONFIG["GW_TZOFFSET"] = "-8" for PST and crate a localtime function instead of gmtime using this offset times the 3600(num sec in 1 hour). Currently get error though.
local function localtime(t,us) -- HOW TO DO THIS? rtctime.epoch2cal doesn't like my "fixed" epoch time local lt = t + CONFIG["GW_TZOFFSET"] * 3600 local tm = rtctime.epoch2cal(lt) return string.format('%04d-%02d-%02d %02d:%02d:%02d GMT',tm["year"],tm["mon"],tm["day"],tm["hour"],tm["min"],tm["sec"]) end
LoraWAN (at least TTN) expects the dates in the json messages to be GMT. In the TTN console they are displayed in your own timezone (at least, for me that is true).
Why do you want to use localtime?
For use in local server and dbases.
On Apr 17, 2017 1:38 PM, "Jaap Braam" [email protected] wrote:
LoraWAN (at least TTN) expects the dates in the json messages to be GMT. In the TTN console they are displayed in your own timezone (at least, for me that is true).
Why do you want to use localtime?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JaapBraam/LoRaWanGateway/issues/28#issuecomment-294585809, or mute the thread https://github.com/notifications/unsubscribe-auth/ADATWOE6FRRz5gZBRBEy5c4xfvtH-DEdks5rw83SgaJpZM4M_h9t .
FYI, my thought was to add it like this so it could be 0 for normal operation.
CONFIG["GW_TZOFFSET"]="0" -- PST CONFIG["GW_TZOFFSET"]="-8"
On Mon, Apr 17, 2017 at 1:41 PM, Doug LaRue [email protected] wrote:
For use in local server and dbases.
On Apr 17, 2017 1:38 PM, "Jaap Braam" [email protected] wrote:
LoraWAN (at least TTN) expects the dates in the json messages to be GMT. In the TTN console they are displayed in your own timezone (at least, for me that is true).
Why do you want to use localtime?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JaapBraam/LoRaWanGateway/issues/28#issuecomment-294585809, or mute the thread https://github.com/notifications/unsubscribe-auth/ADATWOE6FRRz5gZBRBEy5c4xfvtH-DEdks5rw83SgaJpZM4M_h9t .