| author | Simon Descarpentries <sid@sopinspace.com> |
| Tue, 06 May 2014 13:52:01 +0200 | |
| changeset 651 | 9bbc657f6837 |
| parent 0 | 40c8f766c9b8 |
| permissions | -rw-r--r-- |
| 0 | 1 |
import time |
2 |
from django.utils.translation import ugettext as _ |
|
3 |
||
4 |
#http://docs.python.org/lib/module-time.html |
|
5 |
def datetime_to_user_str(dt): |
|
6 |
return dt.strftime(str(_("%Y-%m-%d %H:%M"))) |
|
7 |
||
8 |
#def datetime_to_str(dt): |
|
9 |
# return dt.strftime(CLIENT_DATE_FMT['python_output']) |
|
10 |
||
11 |
def datetime_to_epoch(dt): |
|
12 |
return time.mktime(dt.timetuple()) |
|
13 |
||
14 |
#def datetime_to_js_date_str(dt): |
|
15 |
# print str(1000*mktime(dt.timetuple())) |
|
16 |
# return str(1000*mktime(dt.timetuple())) |