Home    Refresh


Game Time Estimator
(Dynamic - No Refresh needed)
  Game Time Estimator
(Static - Must refresh to update)
  Server Time UTC
(Static - Must refresh to update)
       Year 2, Peret IV-15, 10:54 AM        4/19/2024 1:06:29 AM

server_time and last_rt, below, is Epoch Time ( seconds elapsed since: 01/01/1970 00:00:00 )

server_time:1713488789UTC Timestamp  (Current UTC Epoch Time)
last_rt:1713488721Last Real Time Game Server polled @ 4/19/2024 1:06:29 AM  UTC   (Your Time:  ) was last update received from game server (about every 5 minutes).
last_gt:81687060How many game seconds (not real seconds) has elapsed, since Start of Tale. This is calculated based on Last Egypt Time reported by game server: , received last poll.
diff_rt:68Math: server_time - last_rt = diff_rt  (How many real seconds has elapsed since last poll)
Time ratio:3.2909021806689Ratio is dynamic and is determined by server lag. 'Normally' Egypt time is 3 game minutes = 1 Egypt minute. Ratio will offset that 3 game minutes 'general rule'.
  • Ratio = avg(gt_secs - prev_gt_secs) / avg(rt_secs - prev_rt_secs)
  • Daffy Time Multiplier: 0.9030326064437 Multiplier = 1+(1 - (ratio/3)) . 60 seconds * Multiplier is how many real seconds per minute Game Time.
    diff_gt:224Math: diff_rt * ratio = diff_gt

    Fun fact:   (Note: all values below will dynamically change depending on current ratio)
  • ratio/3 = 1.097
  • 1 + (1 - ratio/3) = 0.903
  • 60s * 0.903 = 54.18s - This means currently 54.18s = 1 Game Minute
  • 54.18s / 3 = 18.06s - This means currently 18.06s = 1 Egypt minute.
  • new_gt:81687284Math: last_gt + diff_gt = new_gt
    gameSecondsToArray(new_gt):Year 2, Peret IV-15, 10:54 AMBased on the new_gt value (game seconds (not real seconds) since beginning of Tale), I can deduce this is the current Egypt Time. Accuracy should be within 1-2 Egypt minutes
    Accuracy depends on how accurate Ratio value is (can change at anytime based on server load and other factors). Ratio value is an average over a period of time.



    Below are Different Clocks you can use on your own website (include with <iframe> or whatever):

    Example (Note you can use http or https, depending on your site, to avoid cross content errors):
    Wiki Research Time Clock Image:

    Generate Image   - Example:  

    Analog Clock:


    https://catitd.com/gameClock_iframe_Analog.asp
    
    <iframe src="https://catitd.com/gameClock_iframe_Analog.asp" width=300 height=300 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>
    

    Tab Time:

    https://catitd.com/gameclock/tabtime.asp   < OR >   https://armeagle.atitd.org/tabtime.php

    This will show current egypt time in tab delimited format. Useful to parse into an array with tab (as seperator) - \t on Javascript/PHP or vbtab on asp/aspx/vbscript.

    HTML Display:  

    Raw Display:  
    
    
    Text Clock:
    
    <iframe src="https://catitd.com/gameClock_iframe.asp" width=420 height=15 frameborder=0 marginheight=0 marginwidth=0></iframe>
    

    Note, below link includes <meta http-equiv="refresh" content="900"> tag, which will refresh the page, automatically, every 15m for ensured accuracy.

    https://catitd.com/gameClock_iframe_simple.asp - Dynamic (time keeps updating without manually refreshing page)

    Additional parmameters you can add to querystring:
    noseconds=yes   ( Don't show (seconds) )
    norefresh=yes   ( Don't include <meta http-equiv="refresh" content="900"> tag - That forces page to refresh every 15m )

    Examples:
    https://catitd.com/gameClock_iframe_simple.asp?noseconds=yes
    https://catitd.com/gameClock_iframe_simple.asp?norefresh=yes
    https://catitd.com/gameClock_iframe_simple.asp?noseconds=yes&norefresh=yes


    Handy VBScript/.asp functions for Time
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    function epoch2date(myEpoch)
    'Convert epoch Time to a Time/Date - ie <%=epoch2Date(1558811159)%>
      epoch2date = DateAdd("s", myEpoch, "01/01/1970 00:00:00")
    end function
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    function date2epoch(myEpoch)
    'Convert a date to Epoch Time - ie blah =  date2epoch(Now)  or <%=date2epoch(Now)%> or myDate = "5/25/2019 7:02:25 PM" <%=date2epoch(myDate)%>
      date2epoch = DateDiff("s", "01/01/1970 00:00:00", myEpoch)
    end function
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    ' Full Credits: ArmEagle, who wrote the original PHP version. Cegaiel simply converted functions from php to vbscript/.asp friendly.
    ' PHP Author: Alex Haan (ArmEagle). ArmEagle has full credits. My credits are minimal and based on converting his original PHP code, to VBScript.
    ' VBScript Author: Michael Sharp (Cegaiel)
    
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    function itemsToGameSeconds( ct_yr, ct_sn, ct_mh, ct_dy, ct_hr, ct_mn, ct_ap )
    
    'ie last_gt = itemsToGameSeconds(3, "Shemu", "IV", 20, 4, 51, "PM")
    'Response.write(last_gt) or <%=last_gt%>
    
    '/*
    '* Input: array of items (year, season, etc)
    '* Output: (game) time seconds since 'start' of tale
    '* Based upon the following parameters, calculate number of game seconds since start
    '* year: digits
    '* season: Akhet, Peret, Shemu
    '* month: I, II, III, IV
    ' * day: digits
    ' * hour: digits
    ' * minute: digits
    ' * am/pm: AM, PM
    ' */
    
    
      '//YEARS
      years = ct_yr
    
      '//SEASONS
    SELECT CASE ct_sn
      CASE "Akhet"
      seasons = 3 * years
      CASE "Peret"
      seasons = 3 * years + 1
      CASE "Shemu"
      seasons = 3 * years + 2
    END SELECT
    
      '//MONTHS
    SELECT CASE ct_mh
      case "I"
        months = 4 * seasons
      case "II"
        months = 4 * seasons + 1
      case "III"
        months = 4 * seasons + 2
      case "IV"
        months = 4 * seasons + 3
    END SELECT
    
     '//DAYS
      days = 30 * months + ct_dy
    
      '//HOURS
      if ct_hr = 12 then
        ahour = 0
       else 
        ahour = ct_hr
      end If
    
    SELECT CASE ct_ap
      case "AM"
        hours = 24 * days + ahour
      case "PM"
        hours = 24 * days + 12 + ahour
    END SELECT
    
      //MINUTES
      mins = 60 * hours + ct_mn
    '  return 60 * mins
    itemsToGameSeconds = 60 * mins
    end function
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    function gameSecondsToArray(new_gt)
    'ie:
    'last_gt = 130416211
    'new_gt_convert = gameSecondsToArray(new_gt)
    '<%=new_gt_convert%> or Response.write(new_gt_convert)
    'This will display as Year 4, Akhet III-9, 10:43 AM
    
    '/*** OUTPUT FUNCTIONS ***/
    
    '/*
    ' * Input: (game) time seconds since 'start' of tale
    ' * Output: (game) time items (year, season, month, etc)
    ' * convert game seconds to array of items (year, season, month, etc)
    ' */
    
    arr_items = array("year", "season", "month", "day", "hour", "minute", "ampm")
    arr_seasons = array("Akhet", "Peret", "Shemu")
    arr_months = array("I", "II", "III", "IV")
    arr_hours = array(12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
    arr_ampm = array("AM", "AM", "AM", "AM", "AM", "AM", "AM", "AM", "AM", "AM", "AM", "AM", "PM", "PM", "PM", "PM", "PM", "PM", "PM", "PM", "PM", "PM", "PM", "PM")
    
    rest = new_gt
    ts_yr = int(rest / 31104000)
    rest = rest Mod 31104000
    ts_sn = int(rest / 10368000)
    rest = rest Mod 10368000
    ts_mh = int(rest / (2592000 + 86400))
    rest = rest Mod 2592000
    ts_dy = int(rest / 86400)
    if ts_dy = 0 Then ts_dy = 30
    rest = rest Mod 86400
    ts_hr = int(rest / 3600)
    rest = rest Mod 3600
    ts_mn = int(rest / 60)
    if ts_mn < 10 Then ts_mn = "0" & ts_mn
    ts_ampm = arr_ampm(ts_hr)
    
    gameSecondsToArray = "Year " & int(ts_yr) & ", " & arr_seasons(ts_sn) & " " & arr_months(ts_mh) & "-" & ts_dy & ", " & arr_hours(ts_hr) & ":" & ts_mn & " " & ts_ampm
    end function
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    

    Copy/Paste friendly version of 'Handy VBScript/.asp functions for Time':