From the reference libraryRedM

autodoc_shared_functions

jo_libs/modules/date/autodoc/autodoc_shared_functions.md

autodoc_shared_functions

JO Functions > jo.date.convertMsToInterval()

A function to convert a time in ms to a readable string <br>

JO Functions > jo.date.convertMsToInterval() > Syntax

jo.date.convertMsToInterval(ms, lang)

JO Functions > jo.date.convertMsToInterval() > Parameters

ms : integer

The duration in ms

lang : table <BadgeOptional />

The list of translatable strings <br> Use false to disable

lang.ms : string - "ms"

lang.s : string - "s"

lang.h : string - "h"

lang.d : string - "d"

lang.s : string - "s"

JO Functions > jo.date.convertMsToInterval() > Example

local gap = 10000003
local forHumain = jo.date.convertMsToInterval(gap)
print(forHumain)
-- Expected output: '2h, 46min, 40s, 3ms'


JO Functions > jo.date.now() > Syntax

jo.date.now()

JO Functions > jo.date.now() > Return Value

Type : integer

The current time in ms

JO Functions > jo.date.now() > Example

local now = jo.date.now()
print(now)

Back to documentation