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

Restrict supported date interval #5

Open
superbobry opened this issue Aug 13, 2012 · 4 comments
Open

Restrict supported date interval #5

superbobry opened this issue Aug 13, 2012 · 4 comments
Labels

Comments

@superbobry
Copy link
Collaborator

It looks like strptime and strftime behaviour for dates before 1900 varies across platforms, so I think we should throw an error on such inputs.

(tempo_dev@yooki)13> tempo:parse(<<"%Y">>, {unix, <<"1505">>}).  %% OS X
{error,format_mismatch}
@ghost ghost assigned superbobry Aug 13, 2012
@si14
Copy link
Contributor

si14 commented Oct 30, 2012

Besided undefined behaviour there is an obvious bug there:

(tempo_dev@si14-laptop)6> tempo:parse(<<"">>, <<"">>, unix).                 
{ok,0.0}     <---- WAT
(tempo_dev@si14-laptop)7> tempo:parse(<<"%Y">>, {unix, <<"1505">>}).
{ok,-14674003200.0}

@superbobry
Copy link
Collaborator Author

What kind of behaviour would you expect? I'd say badarg for both of them.

@si14
Copy link
Contributor

si14 commented Jan 6, 2013

Yup.

@superbobry
Copy link
Collaborator Author

The first case is fixed in 593cd5c, the latter is hard to validate, unfortunately. Any suggestions?

@superbobry superbobry removed their assignment Mar 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants