Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Support custom timezones #24

Closed
DiegoQueiroz opened this issue May 18, 2015 · 6 comments
Closed

Support custom timezones #24

DiegoQueiroz opened this issue May 18, 2015 · 6 comments

Comments

@DiegoQueiroz
Copy link

When I use macros like \today, ShareLatex produces the document using server's system date.
Since the user can be in a different timezone, the document may be produced with an unexpected date.

To illustrate the problem, the current time where I live is May 17, 2015, 11:00pm (Brazil oficial time, GMT-3), but when I compile a document in ShareLatex, \today returns "May 18, 2015".

I think the API should have a timezone setting, so the datetime can be adjusted before compiling the document. The UI can also have an option to allow the user to select its timezone.

@jpallen
Copy link
Contributor

jpallen commented May 18, 2015

In principle, we'd love to make this possible. In practice, it's very very hard. LaTeX takes it's time from the system time, with no way that I know to easily override \today with a custom timezone. There can only ever be one system time on a server, so supporting multiple timezones in an API that serves many users at once currently seems impossible. I'm open to clever workarounds though if someone can find one :)

@jpallen jpallen closed this as completed May 18, 2015
@DiegoQueiroz
Copy link
Author

Sorry, but setting TZ variable is not an option?

Just check out these outputs:
$ echo $TZ
America/Sao_Paulo
$ date
Mon, May 18, 2015 8:35:21 AM
$ TZ=UTC date
Mon, May 18, 2015 11:35:49 AM
$ TZ=GMT-10 date
Mon, May 18, 2015 9:36:07 PM
$ TZ=Asia/Singapore date
Mon, May 18, 2015 7:37:17 PM

So setting TZ variable before call latex binary should work as well. I just to not own a LaTeX environment ready to test it, but I think this simple change may do the trick.

@jpallen jpallen reopened this May 18, 2015
@jpallen
Copy link
Contributor

jpallen commented May 18, 2015

ok, that approach might work. I'll reopen this, thanks.

@DiegoQueiroz
Copy link
Author

Great! :)

@DiegoQueiroz
Copy link
Author

Just to help this implementation, there is a full documentation of TZ variable at http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html.

Also, it would be incredible if the implementation be able to handle Daylight Saving Times (DST). I think ShareLatex UI can guess user's timezone using JavaScript and pass this info to the API.

This way, we avoid the need to keep a table to inform the DST start/end dates of each country (that would be a pain), or force the user to select its timezone/DST info.

@das7pad
Copy link
Member

das7pad commented Aug 6, 2021

Hi!

Thank you for taking the time to write up this issue.

We are in the process of migrating to a monorepo at https://github.com/overleaf/overleaf and will mark this repository read-only soon.
You can read more about the monorepo migration at overleaf/overleaf#923.

We are going to close this issue now to avoid any confusion about the inability to comment further.

If you believe this issue still needs addressing, please create a new issue at https://github.com/overleaf/overleaf.

Thanks again!

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

No branches or pull requests

3 participants