Unixtime(epoch)を取得する
Shell
date +%s
Python
import time
# Unixtime(epoch)がfloat型で返却される
time.time()
date +%s
import time
# Unixtime(epoch)がfloat型で返却される
time.time()
import os
# epoch(Unixtime)がfloat型で返却される
os.path.getmtime('ファイルパス')
10.1. os.path — …
cp /etc/localtime /etc/localtime.bak
cp …
# yum install -y ntpdate
# apt-get install -y ntpdate