Skip to content

How can I force serialization of startDate for an event to include time? #169

Answered by Turnerj
kjlibsol asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @kjlibsol!

At the core of it, we map schema Date to C# int/DateTime and schema DateTime to C# DateTimeOffset. If you supply a C# DateTime, we write that as a schema Date. If you supply a C# DateTimeOffset, we write that as a schema DateTime.

Technically, C# DateTime is compatible with schema DateTime however some properties may imply a requirement for timezone information. For example, an arrivalDate (https://schema.org/arrivalTime) can be quite critical information to potentially get wrong if someone doesn't pass timezone information.

This is the thing though, we really treat dates as two categories:

  • Those of schema Date (date precision via C# DateTime)
  • Those of schema DateTime (dat…

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Turnerj
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #169 on December 15, 2020 15:08.