---
title: JsonDateTimeModelBinder
summary: API reference for JsonDateTimeModelBinder.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
---

# JsonDateTimeModelBinder

Custom `IModelBinder` that tolerantly binds `DateTime` values from either the ASP.NET JSON date wire format (`/Date(ms)/`) or a standard parseable string, never raising a binding error on unparseable input.

## Purpose
- Custom `IModelBinder` that tolerantly binds `DateTime` values from either the ASP.NET JSON date wire format (`/Date(ms)/`) or a standard parseable string, never raising a binding error on unparseable input.

## Context
- Namespace: `SAIF.Web.Mvc.ModelBinders`
- Assembly/package: `SAIF.Framework.Web.Mvc (source-shipping NuGet package)`
- Kind: class

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| BindModel(ControllerContext, ModelBindingContext) | `public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)` | Returns `DateTime()` default when no value is found, null when the raw value is null, parses the `/Date(ms)/` epoch form when present, and falls back to `DateTime.TryParse` otherwise; see the "Bind a JSON date value" operation. |

## Behavioral notes
- A parse failure returns `default(DateTime)` rather than raising a model-state error (see [BR-41](../../business-rules.md#br-41-unparseable-date-binds-to-the-datetime-default)).

## Constraints and usage notes
- Must be registered explicitly (e.g. via `ModelBinders.Binders`) for a `DateTime`-typed property to use this binder instead of the framework default.

## Sources
- `src/Web.Mvc/ModelBinders/JsonDateTimeModelBinder.cs`
