# Format Duration

Grammar — Format Duration(duration)
FlagsNative | Function

Formats a duration in seconds into a localization friendly text value. For example, 150 will become 2:30 in English

# Arguments

  • int — Duration

Returns — text

native text FormatDuration(int seconds);

Category: Conversion / Basic Conversions

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L2301
FormatDuration(FixedToInt(gv_gasOff_DURATION))
// L2307
FormatDuration(FixedToInt(gv_gasOn_DURATION))
// L2345
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L2352
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L2358
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L2301
FormatDuration(FixedToInt(gv_gasOff_DURATION))
// L2307
FormatDuration(FixedToInt(gv_gasOn_DURATION))
// L2345
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L2352
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L2358
FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer)))
// L1895
FormatDuration(FixedToInt(gv_terrazineInactiveDuration))
// L1924
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))
// L1931
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))
// L1937
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))
// L1895
FormatDuration(FixedToInt(gv_terrazineInactiveDuration))
// L1924
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))
// L1931
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))
// L1937
FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer)))

# mods/challenges.sc2mod

LibChal.galaxy

// L1804
FormatDuration(lp_score)