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

Bug in function now() #62

Closed
weixing1531 opened this issue Aug 13, 2019 · 2 comments
Closed

Bug in function now() #62

weixing1531 opened this issue Aug 13, 2019 · 2 comments

Comments

@weixing1531
Copy link

weixing1531 commented Aug 13, 2019

There is a bug in the file "mod_datetime.f90".
type(datetime) function now()
...
now % tz = hour+minute*m2h
Codes should be change to
now % tz = hour+sign(minute,hour)*m2h
or
now % tz = values(4)*m2h

@milancurcic
Copy link
Member

Thanks a lot -- I believe you are correct. Can you give an example case in which the current code produces an erroneous value? I'm trying to understand it better.

@weixing1531
Copy link
Author

For example, if you are in New York or someplace, zone=="-0530", then hour==-5 and minute==30
now % tz = hour+minute*m2h
so tz==-4.50, it is wrong!
the right answer is -5.50!

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