nurse / strptime

a fast strptime engine
Other
38 stars 12 forks source link

Check given format is supported or not #5

Closed mururu closed 9 years ago

mururu commented 9 years ago

Strptime doesn't support all formats which is supported by Time.strptime. It is OK for my use case (except %b for apache access log, I will send a pull request later). But I want to know given format string is valid or not on Strptime gem to fall back to Time.strptime. My ideas are

> Strptime.valid_format?("%s") => false
> Strptime.new("%s") => ArgumentError: invalid format %s

Any thoughts?

mururu commented 9 years ago

Ah, sorry. %b is already supported.

nurse commented 9 years ago

A patch to support other specifiers is welcome until it is in standard.

nurse commented 9 years ago

Ah, raising error is acceptable.

mururu commented 9 years ago

Ah, raising error is acceptable.

Thank you. I will do that way.