Python/サンプル/日時情報のフォーマット・strftime
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* Pythonで日時情報の整形(フォーマット)・strftime [#ae6041...
Pythonでstrftimeを使用して日時を整形(フォーマット)するサ...
#contents
#htmlinsertpcsp(ll-top.html,ll-sp.html)
* 関連記事 [#s746b5dd]
-[[PythonでUNIX時間を取得する方法>Python/サンプル/Python...
-[[Pythonで日時情報を取得する方法・datetime>Python/サンプ...
-[[Pythonで日時情報の整形(フォーマット)・strftime>Python/...
* 動作確認環境 [#bb19c9bf]
$ python --version
Python 2.7.3
$ lsb_release -d
Description: Ubuntu 12.04.4 LTS
* strftimeを使用した日時の整形 [#f8b334ca]
datetimeモジュールおよびstrftimeを使用したサンプルコード...
-サンプルコード
import datetime
d = datetime.datetime.today()
print d.strftime("%Y/%m/%d %H:%M:%S")
print d.strftime("%Y-%m-%d %H:%M:%S")
-実行結果
2014/02/26 11:39:25
2014-02-26 11:39:25
以上、strftimeを使用した日時の整形(フォーマット)のサンプ...
#htmlinsertpcsp(ll-btm.html,ll-sp.html)
終了行:
#navi(../)
* Pythonで日時情報の整形(フォーマット)・strftime [#ae6041...
Pythonでstrftimeを使用して日時を整形(フォーマット)するサ...
#contents
#htmlinsertpcsp(ll-top.html,ll-sp.html)
* 関連記事 [#s746b5dd]
-[[PythonでUNIX時間を取得する方法>Python/サンプル/Python...
-[[Pythonで日時情報を取得する方法・datetime>Python/サンプ...
-[[Pythonで日時情報の整形(フォーマット)・strftime>Python/...
* 動作確認環境 [#bb19c9bf]
$ python --version
Python 2.7.3
$ lsb_release -d
Description: Ubuntu 12.04.4 LTS
* strftimeを使用した日時の整形 [#f8b334ca]
datetimeモジュールおよびstrftimeを使用したサンプルコード...
-サンプルコード
import datetime
d = datetime.datetime.today()
print d.strftime("%Y/%m/%d %H:%M:%S")
print d.strftime("%Y-%m-%d %H:%M:%S")
-実行結果
2014/02/26 11:39:25
2014-02-26 11:39:25
以上、strftimeを使用した日時の整形(フォーマット)のサンプ...
#htmlinsertpcsp(ll-btm.html,ll-sp.html)
ページ名: