Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add serialization for std::chrono::system_clock::time_point #586

Open
@cacharle

Description

I currently have this snippet to all std::chrono::system_clock::time_point to be (de)serialized. I think it would be nice to have something to convert this useful type.

namespace rfl
{
template <>
struct Reflector<std::chrono::system_clock::time_point> {
 using ReflType = std::string;
 static std::chrono::system_clock::time_point to(const ReflType &s)
 {
 return intellis::timePointFromIso8601(s);
 }
 static ReflType from(const std::chrono::system_clock::time_point &tp)
 {
 return intellis::timePointToIso8601<std::chrono::microseconds>(tp);
 }
};

I know that rfl::Timestamp exists but it is limited to seconds which is a deal breaker in my use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /