Sammlung
This commit is contained in:
46
Sammlung/Praktikum/4/app/mytime.py
Normal file
46
Sammlung/Praktikum/4/app/mytime.py
Normal file
@ -0,0 +1,46 @@
|
||||
# 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
|
Reference in New Issue
Block a user