RealDocs

UKismetMathLibrary::IsMorning

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 before 12:00:00 (strictly before noon). Delegates to FDateTime::IsMorning().

Caveats & Gotchas

  • Midnight (00:00:00) is morning — IsMorning returns true. This means a new day that just ticked over at midnight is still considered morning.
  • Like IsAfternoon, this operates on whatever time is stored in the FDateTime — it does not automatically adjust for time zones or convert from UTC.

Signature

static UE_INL_API bool IsMorning( FDateTime A );

Parameters

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

Return Type

bool

Example

Show time-of-day dependent UI text C++
FDateTime LocalNow = FDateTime::Now();
FText Greeting = UKismetMathLibrary::IsMorning(LocalNow)
    ? FText::FromString(TEXT("Good morning!"))
    : FText::FromString(TEXT("Good afternoon!"));
MyTextBlock->SetText(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.