View source for Module:DateInterval

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

local p = {}
local function calculateDate(date, interval, time, timezone)
local currentDate = os.time()
local startDate = os.time{year=date.year, month=date.month, day=date.day, hour=time.hour, min=time.minute, sec=0, isdst=false}
if timezone ~= "" then
local timezoneOffset = os.difftime(os.time(os.date("!*t", startDate)), os.time(os.date("*t", startDate)))
local timezoneCustomOffset = tonumber(timezone:match("([%-%+]%d%d):?%d*")) * 3600 or 0
startDate = startDate + timezoneOffset - timezoneCustomOffset
end
local secondsElapsed = currentDate - startDate
local intervalsElapsed = math.floor(secondsElapsed / (86400 * interval))
local newDateTimestamp = startDate + (intervalsElapsed * 86400 * interval)
local newDate = os.date("*t", newDateTimestamp)
return newDate
end
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0

Template used on this page:

Return to Module:DateInterval.