Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FText
Description
Generate an FText that represents the given timestamp as a date/time in the current culture using the given timezone (default is the local timezone).
This function will convert the given timestamp from UTC (eg, FDateTime::UtcNow()) to the given timezone (taking into account DST). If using a local timestamp (eg, FDateTime::Now()) then you MUST use FText::GetInvariantTimeZone() as the TimeZone argument to avoid additional timezone conversion.
The overload using a custom pattern uses strftime-like syntax (see FDateTime::ToFormattedString).
| Name | AsDate |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Internationalization/Text.h |
| Include Path | #include "Internationalization/Text.h" |
| Source | /Engine/Source/Runtime/Core/Private/Internationalization/Text.cpp |
static FText AsDate
(
const FDateTime & DateTime,
const EDateTimeStyle::Type DateStyle,
const FString & TimeZone,
const FCulturePtr & TargetCulture
)