Skip to main content

Frequently used functions and constants about datetime in Django projects

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_datetime_helpers-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

django_datetime_helpers-0.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page