ModularM
Modular3y ago
15 replies
sa-code

Calling mktime from mojo

I'm trying to call C's mktime from mojo but I seem to get a negative number.

Here's the code, is the external call correct? mktime returns a time_t which should be a positive int, but I see a negative value.

https://github.com/sa-/mo-time/blob/02cf8d1ccdd92ab1ca0863f1538d342d48b18f59/mo_time/date_time.mojo#L73
GitHub
It's time for a time pkg in 🔥 Mojo. Contribute to sa-/mo-time development by creating an account on GitHub.
mo-time/mo_time/date_time.mojo at 02cf8d1ccdd92ab1ca0863f1538d342d4...
Was this page helpful?