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

tm structure for Unix.mktime is incorrect #8326

Closed
vicuna opened this issue Oct 17, 2003 · 2 comments
Closed

tm structure for Unix.mktime is incorrect #8326

vicuna opened this issue Oct 17, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 17, 2003

Original bug ID: 1882
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Dustin Sallings
Version: ocaml 3.06
OS: MacOS X/Linux/NetBSD
Submission from: sjc-dist3-e3.2wire.com (63.203.253.2)

Unix.mktime is documented as taking a tm struct. However, this tm struct uses a
bool for tm_isdst. mktime itself will accept three values for this field (1, 0,
or -1 for yes, no, and figure-it-out). I believe this functionality is
important because I typically don't know whether dst is in effect when parsing a
date, so I rely on mktime to just do the right thing.

@vicuna
Copy link
Author

vicuna commented Oct 21, 2003

Comment author: administrator

Unix.mktime is documented as taking a tm struct. However, this tm
struct uses a bool for tm_isdst. mktime itself will accept three
values for this field (1, 0, or -1 for yes, no, and figure-it-out).
I believe this functionality is important because I typically don't
know whether dst is in effect when parsing a date, so I rely on
mktime to just do the right thing.

Actually, Unix.mktime ignores the tm_isdst boolean field of its
argument, and calls mktime() with dst = -1. So, you get the behavior
you expect. Perhaps the documentation should mention this.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Oct 21, 2003

Comment author: administrator

Implemented behavior is OK. Added documentation 2003-10-21 XL

@vicuna vicuna closed this as completed Oct 21, 2003
@vicuna vicuna added the bug label Mar 19, 2019
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

1 participant