DateTime.Now.ShortDateString

.ShortDateString property converts the date portion of the DateTime object into a string and returns it. The string will be in the following format: MM/DD/YYYY

Applies To

Properties and Methods

None

Available

The .ShortDateString property is available in:

  • 15.03.016
  • All newer builds

Type

String

Syntax

DateTime.Now.ShortDateString;

Parameters

None

Example

var ldToday = DateTime.Today;

var ldNow = DateTime.Now;

var ldNew = new DateTime('06/10/2021 12:34:56');

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

'\nldToday: ' + ldToday.ShortDateString +

'\nldNow: ' + ldNow.ShortDateString +

'\nldNew: ' + ldNew.ShortDateString);

 

/* Expected Prompt response:

Get the .ShortDateString property:

ldToday: 10/25/2021

ldNow: 10/25/2021

ldNew: 06/10/2021

*/