Skip to content

Add precision option to to_datetime_string() #191

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

Closed
leafonsword opened this issue Apr 11, 2018 · 1 comment
Closed

Add precision option to to_datetime_string() #191

leafonsword opened this issue Apr 11, 2018 · 1 comment

Comments

@leafonsword
Copy link

to_datetime_string()'s result just to second precision:

>>> dt = pendulum.now()
>>> dt.to_datetime_string()
'2018-04-11 15:44:44'

Could to_datetime_string() add a option letting user choosing other precison such as millisecond、micosecond? While default precisipn still to be second ~

@sdispater
Copy link
Collaborator

The to_xxx_string() methods are supposed to be simple and with a predictable behavior and thus do not accept options. So unfortunately, I won't be adding a precision option for it.

If you want a more customizable behavior you can use format().

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

2 participants