WEB/Sammlung/Praktikum/4/app/mytime.py

46 lines
1.3 KiB
Python
Raw Normal View History

2016-10-16 21:53:15 +02:00
# coding: utf-8
import json
import os
import codecs
import cherrypy
import time
from app import database
#----------------------------------------------------------
class Time_cl(object):
#----------------------------------------------------------
exposed=True
#----------------------------------------------------------
def __init__(self):
#----------------------------------------------------------
t = time.localtime()
self.date_o = {
"day":"",
"month":"",
"year":"",
"hour":"",
"minute":""
}
self.date_o['day'] = t[2]
self.date_o['month']=t[1]
self.date_o['year']=t[0]
self.date_o['hour']=t[3]
self.date_o['minute']=t[4]
#----------------------------------------------------------
def getDateAsString_px(self):
#----------------------------------------------------------
return str(self.date_o['hour'])+':'+str(self.date_o['minute'])+' | '+str(self.date_o['day'])+'.'+str(self.date_o['month'])+'.'+str(self.date_o['year'] )
#----------------------------------------------------------
def getDate_px(self):
#----------------------------------------------------------
return self.date_o
# EOF