Game Time Estimator (Dynamic - No Refresh needed) |
Game Time Estimator (Static - Must refresh to update) |
Server Time UTC (Static - Must refresh to update) | ||
Year 4, Shemu III-14, 1:04 PM | 12/22/2024 6:24:20 AM |
server_time: | 1734848660 | UTC Timestamp (Current UTC Epoch Time) |
last_rt: | 1734848601 | Last Real Time Game Server polled @ 12/22/2024 6:24:20 AM UTC (Your Time: ) was last update received from game server (about every 5 minutes). |
last_gt: | 151592460 | How 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: | 59 | Math: server_time - last_rt = diff_rt (How many real seconds has elapsed since last poll) |
Time ratio: | 3.2600337972599 | Ratio 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'.
|
Daffy Time Multiplier: | 0.913322067580033 | Multiplier = 1+(1 - (ratio/3)) . 60 seconds * Multiplier is how many real seconds per minute Game Time. |
diff_gt: | 192 | Math: diff_rt * ratio = diff_gt Fun fact: (Note: all values below will dynamically change depending on current ratio) |
new_gt: | 151592652 | Math: last_gt + diff_gt = new_gt |
gameSecondsToArray(new_gt): | Year 4, Shemu III-14, 1:04 PM | Based 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. |
Generate Image | - Example: |
<iframe src="https://catitd.com/gameClock_iframe_Analog.asp" width=300 height=300 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>
<iframe src="https://catitd.com/gameClock_iframe.asp" width=420 height=15 frameborder=0 marginheight=0 marginwidth=0></iframe>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 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 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''