LUA script date after writing

I am new to lua scripting. I have a startDate (“03-05-2014” as “dd-mm-yyyy”) and a span of days (2) anyone Can you help me how to get endDate based on startDate and span?

Example startDate span endDate 
--------- ---- -------
03 -05-2014 2 05-05-2014
(dd-mm-yyyy) (dd-mm-2014)

This can help you

local dayValue, monthValue, yearValue = string.match('31-05-2014', ' (%d%d)-(%d%d)-(%d%d%d%d)')
dayValue, monthValue, yearValue = tonumber(dayValue), tonumber(monthValue), tonumber(yearValue)
now = os.time{year = yearValue, month = monthValue, day = dayValue}
numberOfDays = now + 2 * 24 * 3600
print(os.date("%c", numberOfDays))
dateAfterNumberOfDays = os.date("%a %d %B %Y, %H%p%M",numberOfDays)
print (" after number of days "..dateAfterNumberOfDays) - give you date after number of days

I am new to lua scripting. I have a startDate(“03-05-2014” as “dd-mm-yyyy “) and the span of days (2) Can anyone help me how to get the endDate based on the startDate and span?

Example startDate span endDate 
--------- ---- -------
03 -05-2014 2 05-05-2014
(dd-mm-yyyy) (dd-mm-2014)

This can help You

local dayValue, monthValue, yearValue = string.match('31-05-2014','(%d%d)-(%d%d )-(%d%d%d%d)')
dayValue, monthValue, yearValue = tonumber(dayValue), tonumber(monthValue), tonumber(yearValue)
now = os.time{year = yearValue, month = monthValue, day = dayValue}
numberOfDays = now + 2 * 24 * 3600
print(os.date("%c",numberOfDays))
dateAfterNumberOfDays = os.date ("%a %d %B %Y, %H%p%M",numberOfDays)
print ("
after number of days "..dateAfterNumberOfDays) - give you date after number of days

Leave a Comment

Your email address will not be published.