UKismetMathLibrary::DateTimeFromIsoString
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Parses a date/time string in ISO-8601 format into an FDateTime. Returns true on success, false if the string is malformed or out of range.
Caveats & Gotchas
- • UE's parser does not handle timezone offsets in the ISO string (e.g. '2024-07-04T15:30:00+05:00'). The offset portion is ignored and the result is treated as-is, which may silently produce wrong UTC values.
- • The Result parameter is not reset to a default on parse failure — always check the return value before using Result.
Signature
static UE_INL_API bool DateTimeFromIsoString(FString IsoString, FDateTime& Result); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| IsoString | FString | A date/time string in ISO-8601 format, e.g. "2024-07-04T15:30:00". | — |
| Result | FDateTime& | Output FDateTime populated on success; unchanged on failure. | — |
Return Type
bool Example
Parse a timestamp from a web API response C++
FString IsoStr = TEXT("2024-07-04T15:30:00");
FDateTime Parsed;
if (UKismetMathLibrary::DateTimeFromIsoString(IsoStr, Parsed))
{
UE_LOG(LogTemp, Log, TEXT("Parsed: %s"), *Parsed.ToString());
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Failed to parse ISO date: %s"), *IsoStr);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?