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

strftime formatting of milliseconds #398

Closed
jurta opened this issue Nov 28, 2017 · 1 comment
Closed

strftime formatting of milliseconds #398

jurta opened this issue Nov 28, 2017 · 1 comment

Comments

@jurta
Copy link

jurta commented Nov 28, 2017

Steps to reproduce

  • Timex.now |> Timex.format!("%Y/%m/%d %T.%L", :strftime)
  • or just Timex.now |> Timex.format!("%L", :strftime)
  • fails with:
** (Timex.Format.FormatError) got {:formatter, :unsupported_token, :ms} while retrieving Exception.message/1 for %Timex.Format.FormatError{message: {:formatter, :unsupported_token, :ms}} (expected a string)
    (timex) lib/format/datetime/formatter.ex:58: Timex.Format.DateTime.Formatter.lformat!/4

Description of issue

  • Expected to return a string with milliseconds (000..999) as described in the documentation.

Thanks!

@prook
Copy link

prook commented Jun 5, 2018

The FormatError reason handling may be improved, but the original problem remains: "%L" blows up with {:formatter, :unsupported_token, :ms}, because Timex.Format.DateTime.Formatter lacks format_token for :ms type.

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