verillious / godot-datetime

Datetime utils for Godot

Home Page:https://godotengine.org/asset-library/asset/1391

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ•°οΈ Godot Date Time

Made with Godot Pulse Checks

Datetime utils for Godot


Check out year of our lord for an example of it working in the wild!

πŸ–ŠοΈ Usage

πŸ“š API Documentation

var datetime = DateTime.now()
print(datetime.strftime("%D of %B, %Y %H:%M:%S"))
> "7th of january, 2022 12:04:30"

var tomorrow = datetime.add_days(1).day
print(tomorrow)
> 8

var next_month = datetime.add_months(1).month_name
print(next_month)
> "february"

var two_months_and_a_day = datetime.add_time({"day": 1, "month": 2})
print(two_months_and_a_day)
> "2022-03-08 12:04:30"

😒 Limitations

Currently not supported:

  • Timezones
  • Units smaller than a second
  • DateTime.from_isoformat() with ISOFormat date strings that don't look like YYYY-MM-DDTHH:MM:SS or YYYY-MM-DD HH:MM:SS (you can parse them using DateTime.strptime() if you know how they're formatted, though.)

πŸ™ Credits

πŸͺ This project was created with cookiecutter and the verillious/cookiecutter-godot project template.

🎨 Icon created by Freepik - Flaticon

About

Datetime utils for Godot

https://godotengine.org/asset-library/asset/1391

License:MIT License


Languages

Language:GDScript 100.0%