[libc-commits] [libc] [libc] create TimeReader to look at a struct tm (PR #126138)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Feb 11 12:35:14 PST 2025


================
@@ -22,9 +24,13 @@
 namespace LIBC_NAMESPACE_DECL {
 namespace time_utils {
 
+// calculates the seconds from the epoch for tm_in. Does not update the struct,
+// you must call update_from_seconds for that.
+int64_t mktime_internal(const tm *tm_out);
+
 // Update the "tm" structure's year, month, etc. members from seconds.
 // "total_seconds" is the number of seconds since January 1st, 1970.
-extern int64_t update_from_seconds(int64_t total_seconds, struct tm *tm);
+extern int64_t update_from_seconds(int64_t total_seconds, tm *tm);
----------------
nickdesaulniers wrote:

```suggestion
int64_t update_from_seconds(int64_t total_seconds, tm *tm);
```

https://github.com/llvm/llvm-project/pull/126138


More information about the libc-commits mailing list