| Total Complexity | 4 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 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 |