Passed
Push — master ( 525f7c...1e26bf )
by Dave
01:15
created

backend.fcmutils.formattime()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
#import time
2
3
def safestring(thestring):
4
    '''safely convert anything into string'''
5
    if thestring is None:
6
        return None
7
    if isinstance(thestring, str): return thestring
8
    return str(thestring, "utf-8")
9
10
def formattime(the_time):
11
    '''standard format for time'''
12
    return the_time.strftime('%Y-%m-%d %H:%M:%S')
13