JsonDataLoadOptions.ExactDateTimeParseFormats

JsonDataLoadOptions ExactDateTimeParseFormats property. Gets or sets exact formats for parsing JSON datetime values while loading JSON. The default is null.

JsonDataLoadOptions.ExactDateTimeParseFormats property

Gets or sets exact formats for parsing JSON date-time values while loading JSON. The default is null.

public IEnumerable<string> ExactDateTimeParseFormats { get; set; }

Examples

Shows how to specify exact date time parse format in JSON load options.

string templateString = "**Date:** <<[date]:\"dd MMMM yyyy\">>";
string jsonString = "{ date : \"08/24/2025\" }";
JsonDataLoadOptions jsonLoadOptions = new JsonDataLoadOptions();
jsonLoadOptions.ExactDateTimeParseFormats = new List<string> { "MM/dd/yyyy" };
JsonDataSource ds = new JsonDataSource(new MemoryStream(Encoding.UTF8.GetBytes(jsonString)), jsonLoadOptions);

ReportBuilderContext context = new ReportBuilderContext();
context.DataSources.Add(ds, "");

ReportBuilder.Create(context)
    .From(new MemoryStream(Encoding.UTF8.GetBytes(templateString)), new LoadOptions() { LoadFormat = LoadFormat.Markdown })
    .To(ArtifactsDir + "JsonDataLoadOptions.ExactDateTimeParseFormats.docx")
    .Execute();

See Also