RealDocs

UKismetMathLibrary::IsAfternoon

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns true if the time component of the given FDateTime is 12:00:00 or later (noon or after). Delegates to FDateTime::IsAfternoon().

Caveats & Gotchas

  • Noon exactly (12:00:00.000) is considered afternoon — IsAfternoon returns true and IsMorning returns false at that instant.
  • The check is based on the local time stored in the FDateTime value. If you pass a UTC time without converting it first, the result will be incorrect for users in non-UTC time zones.

Signature

static UE_INL_API bool IsAfternoon( FDateTime A );

Parameters

Name Type Description Default
A FDateTime The DateTime value to check.

Return Type

bool

Example

Branch on time of day C++
FDateTime LocalNow = FDateTime::Now();
if (UKismetMathLibrary::IsAfternoon(LocalNow))
{
    // Show afternoon greeting
}
else
{
    // Show morning greeting
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.