Python/日付・時間
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
-Python関係のWiki
--[[Python]]
--[[Python/MySQL]]
--[[Python/urllib]]
--[[Python/オブジェクト指向]]
--[[Python/外部プログラム実行]]
--[[Python/コマンドライン]]
--[[Python/コンテナ]]
--[[Python/ネットワーク]]
--[[Python/日付・時間]]
--[[Python/ファイル]]
--[[Python/メモリ]]
--[[Python/文字列]]
----
-[[datetime -- 基本的な日付型および時間型:http://www.pyth...
-[[文字列を日付、時刻を表すタプルに変換。時刻を表すタプル...
-[[Epoch Converter:http://www.epochconverter.com/]] ... ...
-[[Date and Time Representation in Python:http://seehuhn....
* 日付とUnix Timeの相互変換 [#md14386b]
import time
:
time.mktime(2009, 10, 28, 0, 0, 0)
1256655600.0
time.localtime(1256655600)
time.struct_time(tm_year=2009, tm_mon=10, tm_mday=28, tm...
import datetime
:
dt = datetime.datetime.fromtimestamp(1256655600)
print dt.strftime('%Y%m%d')
20091028
終了行:
-Python関係のWiki
--[[Python]]
--[[Python/MySQL]]
--[[Python/urllib]]
--[[Python/オブジェクト指向]]
--[[Python/外部プログラム実行]]
--[[Python/コマンドライン]]
--[[Python/コンテナ]]
--[[Python/ネットワーク]]
--[[Python/日付・時間]]
--[[Python/ファイル]]
--[[Python/メモリ]]
--[[Python/文字列]]
----
-[[datetime -- 基本的な日付型および時間型:http://www.pyth...
-[[文字列を日付、時刻を表すタプルに変換。時刻を表すタプル...
-[[Epoch Converter:http://www.epochconverter.com/]] ... ...
-[[Date and Time Representation in Python:http://seehuhn....
* 日付とUnix Timeの相互変換 [#md14386b]
import time
:
time.mktime(2009, 10, 28, 0, 0, 0)
1256655600.0
time.localtime(1256655600)
time.struct_time(tm_year=2009, tm_mon=10, tm_mday=28, tm...
import datetime
:
dt = datetime.datetime.fromtimestamp(1256655600)
print dt.strftime('%Y%m%d')
20091028
ページ名: