BloombergLP::bdlt::TimeUtil::isValidHHMM

Return whether timeValue is a valid packed HHMM integer.

Synopsis

Declared in <bdlt_timeutil.h>

static
bool
isValidHHMM(int timeValue);

Description

Return true if the specified timeValue is a non-negative integer that represents a valid four-digit time value suitable for passing to convertFromHHMM, and false otherwise. timeValue is a valid four-digit time value if, when expressed in decimal notation, it contains exactly four digits (counting leading zeros, if any): two digits for the hour and two digits for the minute, where either 0 <= hour < 24 and 0 <= minute < 60, or 2400 == timeValue.

Return Value

true if timeValue is a valid HHMM encoding

Parameters

NameDescription
timeValuepacked HHMM integer to validate