DateTime.Now.Month

.Second returns the second from the DateTime object. The results will be between 0 and 59.

Note: The DateTime.Today method does not have a time component and will always return a 0.

Applies To

Properties and Methods

None

Available

The .Second property is available in:

  • 15.03.016
  • All newer builds

Type

Int32

Syntax

DateTime.Now.Second;

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 .Second:' +

'\nldToday: ' + ldToday.Second +

'\nldNow: ' + ldNow.Second +

'\nldNew: ' + ldNew.Second);

 

/* Expected Prompt response:

Get the .Second:

ldToday: 0

ldNow: 4

ldNew: 56

*/