You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@steve.apache.org by "gstein (via GitHub)" <gi...@apache.org> on 2025/10/09 12:26:01 UTC

[I] better time zone handling [steve]

gstein opened a new issue, #49:
URL: https://github.com/apache/steve/issues/49

   The codebase uses epoch seconds, but is not clear whether that is UTC or browser-local seconds. Fix this to UTC with browser-shifting.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@steve.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] better time zone handling [steve]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #49:
URL: https://github.com/apache/steve/issues/49#issuecomment-3673421649

   Could you quote/link to the related code block? I may have some time recently to jump into this codebase (again) :D


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@steve.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] better time zone handling [steve]

Posted by "gstein (via GitHub)" <gi...@apache.org>.
gstein commented on issue #49:
URL: https://github.com/apache/steve/issues/49#issuecomment-3673625919

   The two columns "open_at" and "close_at" in the "elections" table (see schema.sql). These columns are set via UPDATE statements (see queries.yaml). The function unixepoch() is used. I don't know what time zone is being used for that.
   
   The epoch seconds are formatted into human-readable times in pages.py:postprocess_election(). That code formats on the server-side regardless of the browser's time zone information. I believe the browser time zone is in the request header (or can be inferred from a date/time in the header), which could then be used to shift the open_at and close_at formatting to the correct time zone.
   
   It is arguable to do the time zone shift and formatting on the client side, but that would seem to require the addition of a new JS library and the associated JS code/complexity to do the formatting (rather than simple EZT template variable insertion on the server's side).
   
   ... Okay. I just did a quick search. There is no such request header (primarily: privacy concern). So TZ adjustments must be done in JS on the client. I haven't done this before, so have no recommendations. I'm sure there are libraries that we can grab and place/serve from v3/server/static/js/ ... the server should ensure any time value is passed to the client in UTC.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@steve.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org