Skip to content

[libc] Implement localtime #107597

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

Open
zimirza opened this issue Sep 6, 2024 · 2 comments
Open

[libc] Implement localtime #107597

zimirza opened this issue Sep 6, 2024 · 2 comments
Labels

Comments

@zimirza
Copy link
Contributor

zimirza commented Sep 6, 2024

localtime should be implemented for libc, which is required by #107285. Temporarily, I am using gmtime. Timezones need to be set up as well.

According to documentation, localtime is defined as the following:

struct tm *localtime(const time_t *timep);
struct tm *localtime_r(const time_t *timep, struct tm *result);
int localtime_s(struct tm *timep, time_t *timep);
@github-actions github-actions bot added the libc label Sep 6, 2024
@lntue lntue changed the title libc: implement localtime [libc] Implement localtime Sep 6, 2024
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Sep 28, 2024
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Sep 28, 2024
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Dec 23, 2024
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Dec 26, 2024
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Dec 26, 2024
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Jan 1, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Jan 3, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Jan 16, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
@nickdesaulniers
Copy link
Member

localtime_r is used in llvm, so that would be useful to have, too.

/llvm-project-main/llvm/lib/Support/Chrono.cpp:30:21: error: no member named 'localtime_r' in the global namespace
   30 |   struct tm *LT = ::localtime_r(&OurTime, &Storage);
      |                   ~~^

@zimirza
Copy link
Contributor Author

zimirza commented Jan 30, 2025

Thank you for the feedback. I will look into if it can find localtime_r in #110363. I have an implementation there.

zimirza pushed a commit to zimirza/llvm-project that referenced this issue Jan 31, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Feb 12, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
zimirza pushed a commit to zimirza/llvm-project that referenced this issue Apr 22, 2025
This is an implementation of localtime.

Closes llvm#107597 and llvm#109892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants