-
Notifications
You must be signed in to change notification settings - Fork 7
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
Proposal: Format all Date/Time values as ISO8601 #7
Comments
Hmm, I was hoping this could be an easy one, but it seems there is a bug in the main weewx that prevents this from working. The plan is to use |
@teeks99 did you ever get this solved? I'm running into an issue where I need an ISO8601 date for some JSON parsing I'm doing in another app, and the current format is unworkable for me. |
So I had some code I put on a branch back in 2021 that did this. However I never merged (or even pushed it) at the time because it didn't work. Since then I've upgraded from python2 to python3 on my weewx instance, and low-and-behold, this was working. I merged in #11 and that should solve this. |
@teeks99 Thanks! I did the same thing last night locally, came back to post my solution here, and lo and behold you've fixed it. I was actually thinking the same thing, it was a Python 2 issue. By the way, I'm running your extension in WeeWX 5 without any changes, and it just works. |
Nice, glad v5 isn't going to break too much. |
I am currently writing two different client apps (a HomeAssistant integration and an ASCOM ObservingConditions driver) that are going to be connecting to WeeWX via your excellent plugin, but I would like to make one suggestion. Would it be possible to format all date/time values in the output as ISO8601 (ex:
2021-10-18T20:20:10+00:0
).The reason I am requesting that we make this change is because, using the current form of
Mon, 18 Oct 2021 15:16:00 EDT
is not able to be accurately parsed on the client side. The timezone abbreviations that are commonly used, such as EDT or CST, are not always able to parsed because it could represent more then one timezone. (see https://stackoverflow.com/a/22868721 for a great explanation)Most importantly, I think we need to replace
generation.time
to use ISO8601, but I think it would be ideal if all the date/time values used in theat
fields were also ISO8601 so that those min/max values could all represent a specific point in time and would minimize the amount of parsing that would be required on client sides. To maintain backwards compatibility for anyone who is currently using this plugin, could this new date form be implemented as a configurable option in WeeWX config?I am not very familiar with Python or Python templates at all, but I would be willing to take a crack at making this change anyways. Before I do, I wanted to run it by you and see if you would be open to a pull request for this change.
Let me know what you think.
The text was updated successfully, but these errors were encountered: