LoginSignup
0
1

More than 5 years have passed since last update.

めざせpythonライブラリマスター (8)rolex

Last updated at Posted at 2016-06-03

【ライブラリ説明】

 日時を操れます。

【プログラム】

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

from rolex import rolex
from datetime import datetime, date


print rolex.parse_datetime(0) 
# 1970-01-01 00:00:00

print rolex.parse_datetime(1234567890)
# 2009-02-13 23:31:30

print rolex.parse_datetime(date(2015, 12, 24))
# 2015-12-24 00:00:00

print rolex.parse_datetime(datetime(2015, 11, 24, 20, 30))
# 2015-11-24 20:30:00

# 5分おきのタイム表示
start = "2014-01-01 03:00:00"
end = "2014-01-01 03:10:00"
print rolex.time_series(start=start, end=end, freq="5min")
# [datetime.datetime(2014, 1, 1, 3, 0), datetime.datetime(2014, 1, 1, 3, 5), datetime.datetime(2014, 1, 1, 3, 10)]

【参考サイト】

 rolex
 github
 document

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