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

Custom converters #687

Closed
huming2207 opened this issue Feb 22, 2018 · 4 comments
Closed

Custom converters #687

huming2207 opened this issue Feb 22, 2018 · 4 comments
Milestone

Comments

@huming2207
Copy link

Hi,

I'm writing a program which needs to convert ISO8601 time string (e.g. 2018-02-22T13:21:00Z as general or 20180222T132100Z for some special cases) to time_t or struct std::tm.

Currently I'm using strptime() function to parse the time string to those two time data types. I'm wondering if I can use .as<time_t>() or .as<struct std::tm>()?

Regards,
Jackson

@bblanchon
Copy link
Owner

Hi Jackson,

I plan on adding custom converters in the future so that anyone can enrich ArduinoJson to support new types.
Unfortunately, I'm currently in the middle of a transformation in the API, so this new feature will have to wait a little.

Regards,
Benoit

@huming2207
Copy link
Author

Hi Benoit,

Thanks for your works, I'm looking forward to try that.

Regards,
Jackson

@bblanchon bblanchon reopened this Feb 23, 2018
@bblanchon bblanchon changed the title Support for parsing ISO8601 time string? Support for custom converters Feb 23, 2018
@bblanchon bblanchon changed the title Support for custom converters Custom converters Feb 23, 2018
@Triangulix
Copy link

Hi
I would also like to chime in on this. I'm currently looking for a way to have enum values serialized as names and not as numbers. I guess custom converters would be a way to implement this.

@bblanchon bblanchon added this to the v6.18 milestone Mar 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2021
@bblanchon
Copy link
Owner

Feature published in ArduinoJson 6.18.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants