DateTime.Now.DaylightSavings

.DaylightSaving returns true if the date falls within the range of dates that would be on daylight savings.

Applies To

Properties and Methods

None

Available

The .DaylightSavings property is available in:

  • 15.03.016
  • All newer builds

Type

Boolean

Syntax

DateTime.Now.DaylightSavings;

Parameters

None

Example

var ldToday = DateTime.Today;

var ldNew = new DateTime('12/10/2021');

Event.Form.MessageBox('Get the .DaylightSavings property:' +

'\nIs ' + ldToday.ShortDateString + ' on daylight savings? ' + ldToday.DaylightSavings +

'\nIs ' + ldNew.ShortDateString + ' on daylight savings? ' + ldNew.DaylightSavings);

 

/* Expected prompt response:

Get the .DaylightSavings property:

Is 10/25/2021 on daylight savings? true

Is 12/10/2021 on daylight savings? false

*/