Version 0.8.13
This commit is contained in:
1 parent
3791ef3ac4
commit
5aa3ce449b
4 files changed
+15
-12
No files matched your search
@@ -9,14 +9,16 @@ from datetime import datetime
|
||||
import pytz
|
||||
from dateutil import parser
|
||||
|
||||
weekdays = ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab']
|
||||
|
||||
def timestamp2str(timestamp, format='%H:%M'):
|
||||
time = datetime.fromtimestamp(timestamp / 1000)
|
||||
def my_strftime(time, format):
|
||||
weekdays = ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab']
|
||||
if '%a' in format:
|
||||
w = int(time.strftime('%w'))
|
||||
format = format.replace('%a', weekdays[w])
|
||||
return time.strftime(format).capitalize()
|
||||
return time.strftime(format)
|
||||
|
||||
def timestamp2str(timestamp, format='%H:%M'):
|
||||
time = datetime.fromtimestamp(timestamp / 1000)
|
||||
return my_strftime(time, format)
|
||||
|
||||
def isodate2date(date_string):
|
||||
date_object = parser.parse(date_string)
|
||||
|
||||
Reference in new issue
Block a user