-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feature request: Take base object as third argument #49
Comments
There's the question whether this should modify the passed "base" object or just copy its components. I could see either case, in the underlying function it is modified directly, but it's also not really necessary at this level of API and it's more polite to leave inputs untouched. As long as it's documented whether it's modified or not. |
The reasons I prefer this solution over the idea in #44 are: It's self documenting - it's not clear what a random boolean argument pertains to; it's more flexible in that it can solve the problem of #48 in a bugwards compatible way, and allow for potentially any other "starting point" object; and it's closer to the underlying strptime API that some may be used to. |
I would prefer generalizing the behavior for GMT flag (copy unspecified fields from base in I would certainly not modify the passed object. For the starting point, I would suggest inheriting only more significant parts. I would not expect the result of |
This idea came about in IRC discussion. Since the underlying OS strptime function allows passing a tm struct and (except on Solaris) will only overwrite the parts of the struct it parses out of the string, it would be nice to provide this capability with Time::Piece. This would provide an alternate solution for both #44 and #48.
The text was updated successfully, but these errors were encountered: