Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本日の日付がモジュール呼び出し時で固定されてしまう #6

Open
terapyon opened this issue May 22, 2019 · 0 comments

Comments

@terapyon
Copy link

https://github.com/recruit-mtl/erajp/blob/master/erajp/converter.py#L20

このモジュールがインポートされた日付で固定されてしまいます。

以下の様にする必要があります。
https://docs.python.org/ja/3/tutorial/controlflow.html#default-argument-values

def strjpftime(time=None), format="%o%E.%m.%d"):
    if time is None:
        time = datetime.datetime.today()
   ...

別の問題ですが、formatという組み込み関数名やtimeという標準ライブラリ名を変数名に使わない方が良いかと思います。

https://docs.python.org/ja/3/library/functions.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant