LoginSignup
0
1

More than 5 years have passed since last update.

めざせpythonライブラリマスター (30)chronyk

Posted at

【ライブラリ説明】

 日時の操作ができる

【プログラム】

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

from chronyk import Chronyk

t = Chronyk(1410531179.0)
t = Chronyk("May 2nd, 2016 12:51 am")
t = Chronyk("yesterday")
t = Chronyk("21. 8. 1976 23:18")
t = Chronyk("2 days and 30 hours ago")

print t.ctime()
# Thu Jun 02 05:45:10 2016
print t.timestamp()
# 1464813910.0
print t.timestring()
# 2016-06-02 06:45:10
print t.timestring("%Y-%m-%d")
# 2016-06-02
print t.relativestring()
# 3 days ago
print t.date()
# 2016-06-02
print t.datetime()
# 2016-06-02 05:45:10

【参考サイト】

 pypi
 github

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