LoginSignup
0
1

More than 5 years have passed since last update.

【Python】1日前のunixtimeを求める

Posted at

コード

test.py
# -*- coding: utf-8 -*-

from datetime import datetime, timedelta

now = datetime.now()
n = now - timedelta(days=+1)
print(n)

m = n.timestamp()
print(m)

実行

2017-08-24 07:11:17.372524
1503583877.372524
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1