lukepierce / brewMonitor

Web Server to Monitor Fermentation
1 stars 1 forks source link

Add time stamp to data model #2

Closed jandersson closed 9 years ago

jandersson commented 9 years ago

https://docs.djangoproject.com/en/1.7/ref/models/fields/#model-field-types

DateTimeField¶

class DateTimeField([auto_now=False, auto_now_add=False, **options])¶ A date and time, represented in Python by a datetime.datetime instance. Takes the same extra arguments as DateField.

The default form widget for this field is a single TextInput. The admin uses two separate TextInput widgets with JavaScript shortcuts.

jandersson commented 9 years ago

import datetime Get timestamp with datetime.datetime.now()

http://stackoverflow.com/questions/415511/how-to-get-current-time-in-python