Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maniartech/mojo-datetime
DateTime library in pure Mojo language
https://github.com/maniartech/mojo-datetime
Last synced: about 4 hours ago
JSON representation
DateTime library in pure Mojo language
- Host: GitHub
- URL: https://github.com/maniartech/mojo-datetime
- Owner: maniartech
- License: mit
- Created: 2024-02-22T07:20:05.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-02-27T10:44:00.000Z (7 months ago)
- Last Synced: 2024-03-26T05:34:30.623Z (6 months ago)
- Size: 43.9 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-max-mojo-mlir - maniartech/mojo-datetime - datetime?style=social"/> : DateTime library in pure Mojo language. (Date and Time)
- awesome-max-mojo-mlir - maniartech/mojo-datetime - datetime?style=social"/> : DateTime library in pure Mojo language. (Date and Time)
README
# Mojo DateTime - Work In Progress
`mojo-datetime` is a library for working with date, time, and timezone information in Mojo programming language.
## Example
```py
from datetime import utc_now, Durationlet now = utc_now()
print("Current time in UTC", now) # Current time in UTC 2021-08-15T12:00:00Zlet local_time = now.add(Duration.hours(5.5))
print("Current time in IST", local_time) # Current time in IST 2021-08-15T17:30:00Zlet tomorrow = now.add(Duration.days(1))
print("Tomorrow in UTC", tomorrow) # Tomorrow in UTC 2021-08-16T12:00:00Z
```