Method IsAM
IsAM(DateTime)
Determines whether the specified time is in the morning (ante meridiem, AM).
public static bool IsAM(DateTime dt)
Parameters
dtDateTimeThe date and time value to evaluate.
Returns
- bool
true if the hour component of the specified date and time is less than 12; otherwise, false.
Remarks
This method checks the hour component of the provided DateTime to determine if it falls within the AM period, which is from 12:00 midnight to 11:59 AM.