Skip to main content

The DateRange type represents a start and end point in time.

Properties

Name Type Description
From DateTime? The datetime the range starts
To DateTime? The datetime the range ends

Remarks

The From and To properties are of type nullable DateTime and can be partly set.

Validation

The From value cannot be a later date than the To value.

Example

Get a DateRange field object

C#
using Zengenti.Contensis.Delivery;

// Create an API client
var client = ContensisClient.Create();

// Retrieve a movie by it's ID.
var movie = client.Entries.Get("0aabad4e-a083-4a88-bd75-b2674e2f8298");

// Get the field value as a DateRange instance.
var filmingPeriod = movie.Get<DateRange>("filmingPeriod");

<span class="start">@filmingPeriod.From</span>
<span class="end">@filmingPeriod.To</span>

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request