Editing Module:D'ni Time

From Guild of Archivists
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 19: Line 19:
local msPerProrahn = msPerHahr / prorahnteePerHahr
local msPerProrahn = msPerHahr / prorahnteePerHahr
local refProrahnteePerHahr = 9647 * 290 * 5 * 25 * 25 * 25
local refProrahnteePerHahr = 9647 * 290 * 5 * 25 * 25 * 25
local vaileetee = {"Leefo","Leebro","Leesahn","Leetar","Leevot","Leevofo","Leevobro","Leevosahn","Leevotar","Leenovoo"}
local vaileetee_dnifont = {"lEfo","lEbro","lEsan","lEtar","lEvot","lEvofo","lEvobro","lEvosan","lEvotar","lEnovU"}


local leapSecTimeStamps = {2272060800, 2287785600, 2303683200, 2335219200, 2366755200, 2398291200, 2429913600, 2461449600, 2492985600, 2524521600, 2571782400, 2603318400, 2634854400, 2698012800, 2776982400, 2840140800, 2871676800, 2918937600, 2950473600, 2982009600, 3029443200, 3076704000, 3124137600, 3345062400, 3439756800, 3550089600, 3644697600, 3692217600}
local leapSecTimeStamps = {2272060800, 2287785600, 2303683200, 2335219200, 2366755200, 2398291200, 2429913600, 2461449600, 2492985600, 2524521600, 2571782400, 2603318400, 2634854400, 2698012800, 2776982400, 2840140800, 2871676800, 2918937600, 2950473600, 2982009600, 3029443200, 3076704000, 3124137600, 3345062400, 3439756800, 3550089600, 3644697600, 3692217600}
Line 196: Line 199:


   return os.date("*t",surfaceTimestamp)
   return os.date("*t",surfaceTimestamp)
end
-- ==========Display Functions=========
local function formatSurfaceTime(surfaceTime,format)
  format = format or 'c'
  lang = mw.getContentLanguage()
  return Date(surfaceTime['year'],surfaceTime['month'],surfaceTime['day'],surfaceTime['hour'],surfaceTime['min'],surfaceTime['sec']):text()
--  return lang:formatDate(format,"@"..makeSurfaceTimeStamp(surfaceTime))
--    return lang:formatDate(format,tostring(surfaceTime['year'])..'-'..tostring(surfaceTime['month'])..'-'..tostring(surfaceTime['day'])..' '..tostring(surfaceTime['hour'])..':'..tostring(surfaceTime['min'])..':'..tostring(surfaceTime['sec']))
end
end


Line 221: Line 238:
     preprocessSingleArg('datetime')
     preprocessSingleArg('datetime')
     preprocessSingleArg('format')
     preprocessSingleArg('format')
    preprocessSingleArg('input')
      
      
     if args['datetime'] then
     if args['datetime'] then
       surfaceTime = surfacefunc.parseSurfaceDateStr(args['datetime'],args['input'])
       surfaceTime = surfacefunc.parseSurfaceDateStr(args['datetime'])
       output = dnifunc.formatDniTime(surface2DniTime(makeSurfaceTimeStamp(surfaceTime)),args['format'])
       output = dnifunc.formatDniTime(surface2DniTime(makeSurfaceTimeStamp(surfaceTime)),args['format'])
     else  
     else  
Line 235: Line 251:


       -- Parse the data parameters
       -- Parse the data parameters
       surface = {year = args['year'], month = args['month'] or 1, day = args['day'] or 1, hour = args['hour'] or 0, min = args['minute'] or 0, sec = args['second'] or 0}
       surface = {year = args['year'], month = args['month'], day = args['day'], hour = args['hour'], min = args['minute'], sec = args['second']}


---      output =  dnifunc.displayDniTime(surface2DniTime(makeSurfaceTimeStamp(surface)),args['format'])
---      output =  dnifunc.displayDniTime(surface2DniTime(makeSurfaceTimeStamp(surface)),args['format'])
Line 257: Line 273:


     if args['datetime'] then
     if args['datetime'] then
       output = surfacefunc.formatSurfaceTime(dni2SurfaceTime(dnifunc.parseDniDateStr(args['datetime'],args['input'])),args['format'])
       output = formatSurfaceTime(dni2SurfaceTime(dnifunc.parseDniDateStr(args['datetime'],args['input'])),args['format'])
     else  
     else  
       preprocessSingleArg('hahr')
       preprocessSingleArg('hahr')
Line 271: Line 287:


--      output = surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni),args['format'])
--      output = surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni),args['format'])
       output = surfacefunc.formatSurfaceTime(dni2SurfaceTime(dni),args['format'])
       output = formatSurfaceTime(dni2SurfaceTime(dni),args['format'])
     end
     end
      
      
Line 301: Line 317:
     output = output .. "<br/>"..surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni))
     output = output .. "<br/>"..surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni))
     output = output .. "<br/>"..os.date("ghdd",makeSurfaceTimeStamp(surface))
     output = output .. "<br/>"..os.date("ghdd",makeSurfaceTimeStamp(surface))
--    output = output .. "<br/>"..surfacefunc.formatSurfaceTime(surface,args['format'])
--    output = output .. "<br/>"..formatSurfaceTime(surface,args['format'])
--    output = output .. "<br/>"..makeSurfaceTimeStamp(surface)
--    output = output .. "<br/>"..makeSurfaceTimeStamp(surface)
--    output = output .. "<br/>"..lang:formatDate("c","@"..makeSurfaceTimeStamp(surface))
--    output = output .. "<br/>"..lang:formatDate("c","@"..makeSurfaceTimeStamp(surface))
Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see GoArch:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: