Skip to content

Conversation

@Gargaj
Copy link

@Gargaj Gargaj commented May 17, 2024

@epezent
Copy link
Owner

epezent commented Dec 24, 2024

@Gargaj I think your code is missing an important step:

Portability note: mktime is essentially universally available. timegm is rather rare. For the most portable conversion from a UTC broken-down time to a simple time, set the TZ environment variable to UTC, call mktime, then set TZ back.

@Gargaj
Copy link
Author

Gargaj commented Dec 24, 2024

This has been a while so I don't specifically remember what was being broken, but the functions I was trying to fix were not available on one of the current generation consoles.

@skarolewics
Copy link

I am encountering the same issue as @Gargaj, and the platform in question does not support time zone setting via functions like tzset().

I was able to workaround by defining replacements for timgm and other functions before including implot.cpp, but it is a bit of a hack. Perhaps for robustness of the ImPlot API, a #define could be optionally provided to override implementation of the time related functions, to enable implementation sites to control behavior for specific platforms.

@CA-Jon-Colverson
Copy link

@skarolewics Would you be able to share your replacement for timegm?

@skarolewics
Copy link

@CA-Jon-Colverson I used the solution described here: https://stackoverflow.com/a/68761107

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

Successfully merging this pull request may close these issues.

4 participants