RealDocs

UKismetStringLibrary::TimeSecondsToString

function Engine Blueprint Since unknown
#include "Kismet/KismetStringLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Converts a number of seconds into a minutes:seconds.milliseconds string with leading zeroes, suitable for displaying timers or stopwatch UI.

Caveats & Gotchas

  • The format is fixed at minutes:seconds.milliseconds — there is no way to request hours or a different separator from this function.
  • Negative input isn't clamped or validated; formatting a negative duration produces a malformed-looking string rather than an error.

Signature

static FString TimeSecondsToString(float InSeconds)

Parameters

Name Type Description Default
InSeconds float The number of seconds to format.

Return Type

FString

Example

Display a race timer C++
const FString TimerText = UKismetStringLibrary::TimeSecondsToString(125.437f);
// TimerText == "02:05.437"

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.