Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add localization to the time stamps #28

Open
dlarue opened this issue Apr 17, 2017 · 3 comments
Open

add localization to the time stamps #28

dlarue opened this issue Apr 17, 2017 · 3 comments

Comments

@dlarue
Copy link
Contributor

dlarue commented Apr 17, 2017

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

@JaapBraam
Copy link
Owner

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?

@dlarue
Copy link
Contributor Author

dlarue commented Apr 17, 2017 via email

@dlarue
Copy link
Contributor Author

dlarue commented Apr 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants