UKismetTextLibrary::AsTime_DateTime
#include "Kismet/KismetTextLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Converts a date & time to text formatted as a time only, using an invariant timezone with no conversion applied.
Caveats & Gotchas
- • No timezone conversion happens here — use AsTimeZoneTime_DateTime if the source value is UTC and needs converting to a display timezone.
- • Only the time-of-day is rendered; any date information in the input is discarded, so this is not suitable for display where the date also matters (e.g. events more than a day out).
Signature
static FText AsTime_DateTime(const FDateTime& In, TEnumAsByte<EDateTimeStyle::Type> InTimeStyle = EDateTimeStyle::Default); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| In | const FDateTime& | The date and time to format. Used as-is, assumed already in the correct timezone. | — |
| InTimeStyle | TEnumAsByte<EDateTimeStyle::Type> | Formatting style: Default, Short, Medium, Long, or Full. | EDateTimeStyle::Default |
Return Type
FText Example
Format a time for display C++
FDateTime EventStart = FDateTime(2026, 12, 25, 18, 30, 0);
FText TimeText = UKismetTextLibrary::AsTime_DateTime(EventStart, EDateTimeStyle::Short); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?