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

Changed toIso8601String helper function #1063

wants to merge 1 commit into from


Copy link

@afrojuju1 afrojuju1 commented Jan 10, 2018

Changed toIso8601String to take in a boolean which when false would remove the timezone from ISO8601 string.
This adds extra flexibility around ISO8601 string format.

This adds extra flexibility around ISO8601 string format
Copy link

@Glavic Glavic commented Feb 13, 2018

If you need custom format, why don't you use ->format() method?

Copy link

@kylekatarnls kylekatarnls commented Feb 13, 2018

Each ->toX method should be reserved for one format. I recommend you to extend the class (or use a macro if you work with Laravel) to create an other method for your custom format.

Copy link

@briannesbitt briannesbitt commented Feb 13, 2018

We would implement this as a separate method anyway, no boolean param. But regardless, doesn't need to go into Carbon. Sounds like a good place for your own class.

Copy link

@kylekatarnls kylekatarnls commented Apr 13, 2018

Will appear in the documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants