DateTime.Now
DateTime.Now pulls the current date and time down to the millisecond.
Applies To
Properties and Methods
Properties
- .Day
- .DaylightSavings
- .DayOfWeek
- .DayOfYear
- .Hour
- .ISOString
- .LongDateString
- .LongTimeString
- .Minute
- .Month
- .Second
- .ShortDateString
- .ShortTimeString
- .Year
Methods
- .AddDays(Days)
- .AddHours(Hours)
- .AddMinutes(Minutes)
- .AddMonths(Months)
- .AddSeconds(Seconds)
- .AddYears(Years)
- .Compare(To)
- .Copy()
- .StringDayOfWeek([Culture])
- .StringMonth([Culture])
Available
The .Now property is available in:
- 15.03.016
- All newer builds
Type
DateTime
Syntax
DateTime.Now;
Parameters
None
Example
var ldDateTime = DateTime.Now;
Event.Form.MessageBox('ldDateTime: ' + ldDateTime.ShortDateString + ' ' + Utility.FormatTime(ldDateTime, true));
/* Expected prompt response:
ldDateTime: 10/22/2021 04:42:15pm
*/
.Now will always pull the date and time down to the millisecond