Skip to content

Frequently used functions and constants about datetime in Django projects

License

Notifications You must be signed in to change notification settings

eugen1j/django-datetime-helpers

Repository files navigation

django-datetime-helpers

Build Status codecov PyPI version License: MIT

Frequently used functions and constants about datetime in Django projects

Installing

pip install django-datetime-helpers

Examples

# Quering all Users who join today
users = User.objects.filter(
    created_at__date=today()
)

# Quering all Users who join in last 12 hours
users = User.objects.filter(
    created_at__gte=secons_ago(12 * HOUR)
)

# Declaring constanst
USER_SOMETHING_TIMEOUT = 5 * MINUTE

# Waiting for something
time.sleep(MINUTE)

For more examples see source code.

About

Frequently used functions and constants about datetime in Django projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published