Skip to main content

datetime field with 'elapsed' attr

Project description

Installation

$ [sudo] pip install django-datetime-elapsed-field

Classes

class __doc__
django_datetime_elapsed_field.DateTimeElapsedField models.DateTimeField subclass with elapsed attr

Examples

>>> from django.db import models
>>> from django_datetime_elapsed_field import DateTimeElapsedField

>>> class Example(models.Model):
        created_at = DateTimeElapsedField(auto_now_add=True)
>>> instance = Example.objects.get(id=42)
>>> instance.created_at.elapsed
'15:26:51'
>>> int(instance.created_at.elapsed)
55611
>>> instance.created_at.elapsed.seconds
55611
>>> instance.created_at.elapsed.minutes
926
>>> instance.created_at.elapsed.hours
15
>>> instance.created_at.elapsed.days
0

readme-generator

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django_datetime_elapsed_field-2019.3.22-py2.py3-none-any.whl (25.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3
django-datetime-elapsed-field-2019.3.22.tar.gz (1.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page