UKismetMathLibrary::GetMillisecond
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the millisecond component of A in the range 0–999. This is the sub-second remainder after extracting full seconds.
Caveats & Gotchas
- • FDateTime stores time at 100-nanosecond (tick) resolution internally, but GetMillisecond discards sub-millisecond ticks. For high-precision timing comparisons use FDateTime::GetTicks() directly rather than reconstructing from components.
- • This is the millisecond within the current second, not total elapsed milliseconds. For total elapsed milliseconds since a reference point use Subtract_DateTimeDateTime and call GetTotalMilliseconds() on the resulting FTimespan.
Signature
static UE_INL_API int32 GetMillisecond( FDateTime A ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FDateTime | The date-time to extract the millisecond from. | — |
Return Type
int32 Example
Log a high-resolution timestamp C++
FDateTime Now = FDateTime::UtcNow();
int32 S = UKismetMathLibrary::GetSecond(Now);
int32 MS = UKismetMathLibrary::GetMillisecond(Now);
UE_LOG(LogTemp, Log, TEXT("Time: ...:%02d.%03d"), S, MS); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?