|
# -*- coding: utf-8 -*-
import os
import time
def local_string():
return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
def set_time(timestr):
# with open('/ramfs/current_time', 'w') as f:
# f.write('date -s "{}"'.format(timestr))
dates = 'date -s "{}"'.format(timestr)
os.system("echo '{}' > /ramfs/current_time_tmp; mv /ramfs/current_time_tmp /ramfs/current_time".format(dates))
|