Timestamp to year and month||doc136012

September 20, 2022

Format

 Lib.getYearMonthStr(time) 
  • The class to which the function belongs:Lib

Description

The timestamp is converted into months, and the result is 201909.


Parameters

Variable name type Description
time int Timestamp, which can be obtained by os.time()


Value Returned

type Description
string year month string


Code Samples

local toMonth = tonumber(Lib.getYearMonthStr(os.time()))