PageSourceSearch

https://www.epochconverter.com/js/epoch-home.min.js?v=115

js epochconverter.com collected 2026-09-24 08:24:55 UTC 13,877 bytes, 1 lines download raw bytes

1var epochInputUnitOverride="auto",epochInputUnitCurrent="seconds",epochInputUnitValue=0;function capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}function toggleEpochInputUnitMenu(e){e&&e.preventDefault();var t=document.getElementById("epoch-unit-menu"),n=document.getElementById("epoch-unit-trigger");n&&(t||(t=createEpochInputUnitMenu(),n.parentNode.appendChild(t)),t.hidden?(t.hidden=!1,n.setAttribute("aria-expanded","true")):closeEpochInputUnitMenu())}function closeEpochInputUnitMenu(e){var t=document.getElementById("epoch-unit-menu"),n=document.getElementById("epoch-unit-trigger"),a=t&&!t.hidden;t&&(t.hidden=!0),n&&n.setAttribute("aria-expanded","false"),e&&a&&n&&n.focus()}function selectEpochInputUnit(e,t){e&&e.preventDefault(),epochInputUnitOverride=t,EpochToHuman(!0);var n=document.getElementById("epoch-unit-trigger");n&&n.focus()}function epochInputUnitAlternatives(){for(var e=["seconds","milliseconds","microseconds","nanoseconds"],t=["seconds","milliseconds","microseconds","nanoseconds"],n=[],a=0;a<e.length;a++)e[a]!==epochInputUnitCurrent&&epochInputUnitFitsDateRange(e[a])&&n.push({unit:e[a],label:t[a]});return n}function createEpochInputUnitMenu(){var e=epochInputUnitAlternatives(),t=document.createElement("span");t.id="epoch-unit-menu",t.className="epoch-unit-menu",t.hidden=!0;for(var n=0;n<e.length;n++){var a=document.createElement("a");a.href="#",a.dataset.epochUnit=e[n].unit,a.textContent=e[n].label,a.addEventListener("click",function(e){return function(t){selectEpochInputUnit(t,e)}}(e[n].unit)),t.appendChild(a)}return t}function epochInputUnitFitsDateRange(e){var t=parseEpochTimestampValue(epochInputUnitValue,e);return null!==t&&Math.abs(t.milliseconds)<=864e13}function epochInputUnitPicker(e){var t=document.createElement("span");t.className="epoch-unit-picker";var n=document.createElement("a");n.href="#",n.id="epoch-unit-trigger",n.className="epoch-unit-trigger",n.setAttribute("role","button"),n.setAttribute("aria-label","Change timestamp unit"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls","epoch-unit-menu"),n.addEventListener("click",toggleEpochInputUnitMenu);var a=document.createElement("b");a.textContent=e,n.appendChild(a);var i=document.createElement("i");return i.className="fa fa-angle-down",i.setAttribute("aria-hidden","true"),n.appendChild(i),t.appendChild(n),t}function mountEpochInputUnitPicker(e){var t=document.getElementById("epoch-unit-picker-slot");if(t)if(t.textContent="",0===epochInputUnitAlternatives().length){var n=document.createElement("b");n.textContent=e,t.appendChild(n)}else t.appendChild(epochInputUnitPicker(e))}function EpochToHuman(e){e||(epochInputUnitOverride="auto");var t=document.getElementById("ecinput").value,n=epochInputUnitOverride,a="<br>&nbsp;",i="Sorry, this timestamp is not valid.<br>Check your timestamp, strip letters and punctuation marks.",r="",o="",u=parseEpochInputValue(t,n);if(u){if(u.normalizedInput!=t.trim()&&(r+="Converting "+u.normalizedInput+":<br>"),u.hexadecimal)r+='Converting <a href="/hex?q='+u.normalizedInput.replace(/^([+-]?)0[xX]/,"$1")+'">hexadecimal timestamp</a> to decimal: '+u.hexadecimal.decimal+"<br>";Ax()||(u=parseEpochInputValue("0",n)),epochInputUnitValue=u.timestampInput;var s=u.numericValue,c=' class="utcal"';s>=1e8&&s<18e7&&(o+="<br>Expected a more recent date? You are missing 1 digit.");var l=u.unit;epochInputUnitCurrent=l,r+=("auto"===n?"Assuming that this timestamp is in ":"Interpreting this timestamp as ")+'<span id="epoch-unit-picker-slot"></span><br>',"seconds"===l&&"auto"===n&&(s>1e11||s<-1e10)&&(o+="<br>Remove the last 3 digits if you are trying to convert milliseconds."),u.milliseconds<-68572224e5&&(o+="<br>Dates before 14 september 1752 (pre-Gregorian calendar) are not accurate.");var d=u.date;if(isValidDate(d)){var p=formatEpochGMTString(d),m=formatEpochLocaleString(d,1),h=formatRelativeFromNow(d,"en");r+="<b"+c+'>UTC</b>: <span id="result1-utc">'+p+"</span>"+resultCopyButton("result1-utc","Copy","UTC"),r+="<br><b"+c+'>Local time</b>: <span id="result1-local" title="'+d.toDateString()+" "+d.toTimeStr
1ing()+'">'+m+"</span>"+resultCopyButton("result1-local","Copy","Local time"),r+=' <a title="convert to other time zones" href="https://www.epochconverter.com/timezones?q='+Math.floor(d.getTime()/1e3)+'">UTC'+getTimezoneOffsetLabel(d)+"</a>",isDateDST(d)&&(r+=' <span class="help" title="Daylight Saving Time">DST</span>',d.getFullYear()<1908&&(o+="<br>DST (Daylight Saving Time) was first used around 1908.<br>Your browser uses the current DST rules for all dates in history.")),h&&(r+="<br><b"+c+">Relative</b>: "+capitalizeFirst(h)),o&&(r+="<br><br>Note: "+o)}else r+=i;renderResult("result1",r+a),mountEpochInputUnitPicker({seconds:"seconds",milliseconds:"milliseconds",microseconds:"microseconds (1/1,000,000 second)",nanoseconds:"nanoseconds (1 billionth of a second)"}[l])}else renderResult("result1",i+a)}function HumanToEpochTZ(e){var t=createHDate("hf");if("object"==typeof t){var n=t[0],a=t[1],i=ec_is_ms(),r=n.getTime()/1e3,o=n.getTime();"hex"===e&&(r=Math.floor(r).toString(16).toUpperCase(),o=o.toString(16).toUpperCase());var u="<span class='utcal'>"+(i?"":"<b>")+"Timestamp"+(i?"":"</b>")+'</span>: <span id="hf-result-s">'+r+'</span><button type="button" class="copy-btn mini" data-copy-id="hf-result-s" title="Copy"><i class="fa fa-copy"></i></button><br>';if(u+="<span class='utcal'>"+(i?"<b>":"")+"Timestamp in ms"+(i?"</b>":"")+'</span>: <span id="hf-result-ms">'+o+'</span><button type="button" class="copy-btn mini" data-copy-id="hf-result-ms" title="Copy"><i class="fa fa-copy"></i></button><br>',u+="<span class='utcal'>"+(a?"<b>":"")+"UTC"+(a?"</b>":"")+"</span>: "+formatEpochGMTString(n)+"<br>",u+="<span class='utcal'>"+(a?"":"<b>")+"Local time"+(a?"":"</b>")+"</span>: "+formatEpochLocaleString(n),isDateDST(n)&&(u+=' <span class="help" title="Daylight Saving Time">DST</span>'),Ax()){renderResult("hf-result",u);var s=document.getElementById("hf-result");s&&(s.dataset.outputType="hex"===e?"hex":"decimal")}}}function humanToHex(){return HumanToEpochTZ("hex")}function TimeCounter(){var e="",t=document.getElementById("scinput").value,n=calculateDurationBreakdown(t);if(n){n.totalSeconds&&n.totalSeconds!=t&&(e+="Converting "+n.totalSeconds+":<br>");var a=n.parts.map((function(e){var t=e.value;return"day"===e.unit&&t>=1e3&&(t=t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")),t+(1!==e.value?" "+e.unit+"s":" "+e.unit)}));if(1===a.length?e+=a[0]+".":e+=a.slice(0,-1).join(", ")+" and "+a[a.length-1]+".",n.approximateParts.length){var i=n.approximateParts.map((function(e){return e.value+(1!==e.value?" "+e.unit+"s":" "+e.unit)}));i.length&&(e+="<br>Approx. "+i.join(", ")+".")}n.exceedsOneHundredYears&&(e+='<br><span class="epochwarn">&#9888; This value exceeds 100 years. If your value is in milliseconds, remove the last 3 digits.</span>'),renderResult("result4",e),trck("Seconds")}else renderResult("result4","Invalid input.")}document.addEventListener("click",(function(e){var t=document.getElementById("epoch-unit-menu");!t||t.hidden||e.target.closest(".epoch-unit-picker")||closeEpochInputUnitMenu()})),document.addEventListener("keydown",(function(e){var t=document.getElementById("epoch-unit-menu");"Escape"===e.key&&t&&!t.hidden&&(e.preventDefault(),closeEpochInputUnitMenu(!0))}));var currentBeginEnd="month",beginEndToggle=null;function updateBe(e){beginEndToggle&&beginEndToggle.setActive(e,!0);var t=document.getElementById("br");t&&e!=currentBeginEnd&&("day"==e&&(t.elements.mm.disabled=!1,t.elements.dd.disabled=!1),"month"==e&&(t.elements.mm.disabled=!1,t.elements.dd.disabled=!0),"year"==e&&(t.elements.mm.disabled=!0,t.elements.dd.disabled=!0),currentBeginEnd=e,beginEnd())}function beginEnd(){var e=document.getElementById("br");if(e){var t=e.elements.tz.value,n=currentBeginEnd,a=e.elements.mm.value,i=e.elements.dd.value,r=e.elements.yyyy.value,o=ec_is_ms(),u=calculatePeriodBoundaries({period:n,year:r,month:a,day:i,localTime:2==t,useMilliseconds:o});if(u.error){renderResult("br-result","<b>Please check your input.</b><br>"+{year:"Invalid year",month:"Invalid month",day:"Invalid day"}[u.error.field]+": "+u.error.value)}else{var s='<table class="infotable table-tool"><thead><tr><th>
1</th><th>Epoch</th><th>Date and time</th></tr></thead><tbody><tr><td>Start of '+n+":&nbsp;</td><td>",c=u.startDate,l=u.endDate,d=c.getTime()/(o?1:1e3),p=l.getTime()/(o?1:1e3);s+='<span id="br-s">'+d+'</span><button type="button" class="copy-btn mini" data-copy-id="br-s" title="Copy"><i class="fa fa-copy"></i></button></td><td>',s+=2==t?formatEpochLocaleString(c):formatEpochGMTString(c),s+="</td></tr>",s+="<tr><td>End of "+n+":&nbsp;</td><td>",s+='<span id="br-e">'+p+'</span><button type="button" class="copy-btn mini" data-copy-id="br-e" title="Copy"><i class="fa fa-copy"></i></button></td><td>',s+=2==t?formatEpochLocaleString(l):formatEpochGMTString(l),s+="</td></tr></tbody></table>",renderResult("br-result",s)}}}function homepageStart(){var e=[];if("function"!=typeof initDateSelector&&e.push("initDateSelector"),"function"!=typeof timerStart&&e.push("timerStart"),"function"!=typeof window.bindCalToggleGroup&&e.push("bindCalToggleGroup"),e.length)throw new Error("Homepage initialization failed: missing "+e.join(", ")+".");timerStart(0,1,"#ecclock","#ecinput"),"function"==typeof autoFillQuery&&autoFillQuery(),beginEndToggle=window.bindCalToggleGroup({groupSelector:"#br .cal-toggle-group",idPrefix:"br-opt-",activeClass:"active",onChange:updateBe});var t=new Date;document.querySelector("#br input[name=dd]").disabled=!0,document.querySelector("#fs input[type=text][name=DateTime]").value=t.toISOString().replace(/\.\d{3}Z$/,"Z"),document.getElementById("scinput").value=1209600,document.addEventListener("keydown",(function(e){if(!e.target.matches("input#ecinput, input#rcinput")&&!(e.ctrlKey||e.altKey||e.metaKey)){var t="string"==typeof e.key?e.key.toLowerCase():"";switch(-1!=="echirstymd".indexOf(t)&&e.preventDefault(),t){case"e":kp("ecinput"),jumpTo("efhead");break;case"c":emptyFields();break;case"t":var n=document.getElementById("hf"),a=n&&(n.dataset.format||n.getAttribute("data-format"))||"ymd",i="dmy"===a?"dd":"mdy"===a?"mm":"yyyy";document.querySelector("#hf input[name="+i+"]").focus(),document.querySelector("#hf input[name="+i+"]").select(),jumpTo("efhead");break;case"i":case"r":kp("rcinput"),jumpTo("fs");break;case"s":kp("scinput"),jumpTo("tchead");break;case"y":updateBe("year"),document.querySelector("#br input[name=yyyy]").focus(),document.querySelector("#br input[name=yyyy]").select(),jumpTo("brhead");break;case"m":updateBe("month"),document.querySelector("#br input[name=mm]").focus(),document.querySelector("#br input[name=mm]").select(),jumpTo("brhead");break;case"d":updateBe("day"),document.querySelector("#br input[name=dd]").focus(),document.querySelector("#br input[name=dd]").select(),jumpTo("brhead")}}}));var n=getUrlParam("q");!n||isNaN(n)&&!isHex(n)||(document.getElementById("ecinput").value=n,EpochToHuman()),selectInitialInputValue("#ecinput"),selectInitialInputValue("#fs input[name=DateTime]"),selectInitialInputValue("#scinput")}function hexDecimalResult(e){return'Decimal timestamp: <span id="resulthex-dec">'+e+'</span><button type="button" class="copy-btn mini" data-copy-id="resulthex-dec" title="Copy" aria-label="Copy: Decimal timestamp"><i class="fa fa-copy" aria-hidden="true"></i></button>'}function hexDecimalInputWarning(e){return e.hasPrefix||!Number.isFinite(Number(e.normalized))?"":'<br><span class="epochwarn">&#9888; This is a decimal number. Please double check the result, or try using the <a href="/?q='+Number(e.normalized)+'">decimal converter</a>.</span>'}function hexLittleEndianNotice(e){var t=/^(?:0[xX])?([0-9a-fA-F]+)$/.exec(e.normalized);if(!t||t[1].length<8||t[1].length%2!=0)return"";var n,a=t[1].match(/.{2}/g).reverse().join("").toUpperCase();if(a===t[1].toUpperCase())return"";try{n=BigInt("0x"+a)}catch(e){return""}var i=n>=BigInt(1e11)?n:n*BigInt(1e3),r=BigInt(Date.now()),o=r-BigInt(315576e6),u=r+BigInt(315576e5);return i<o||i>u?"":'<br><span class="epochwarn little-endian-notice">&#9888; The byte-reversed value matches a recent date. If this is a little-endian timestamp, try <a href="/hex?q='+a+'">'+a+"</a>.</span>"}function hexToHuman(){var e=parseHexTimestampValue(document.getElementById("hextime").value);if(null!==e){var t,n,a=hexLittleEndianNotice(e),i=BigInt(1e11);e.exactValue>=i||e.exactValue<=-i?(n="Assuming that this timestamp is in <b>milliseconds</b>:<br>",t=e.exactValue):(n="Assuming that this timestamp is in <b>seconds</b>:<br>",t=e.exactValue*BigInt(1e3));var r=BigInt(864e13);if(t<-r||t>r)return n="Sorry, this hexadecimal timestamp is outside the supported date range.<br>"+hexDecimalResult(e.decimal)+hexDecimalInputWarning(e)+a,void renderResult("resulthex",n);var o=new Date(Number(t)),u=formatEpochGMTString(o),s=formatEpochLocaleStr
1ing(o,1);n+='<b>UTC</b>: <span id="resulthex-utc">'+u+"</span>"+resultCopyButton("resulthex-utc","Copy","UTC"),n+='<br><b>Local time</b>: <span id="resulthex-local">'+s+"</span>"+resultCopyButton("resulthex-local","Copy","Local time")+" UTC"+getTimezoneOffsetLabel(o),isDateDST(o)&&(n+=' <span class="help" title="Daylight Saving Time">DST</span>'),n+="<br>"+hexDecimalResult(e.decimal),n+=hexDecimalInputWarning(e),n+=a,renderResult("resulthex",n)}else renderResult("resulthex","Sorry, this hexadecimal timestamp is not valid.")}function isDateDST(e){return e.getTimezoneOffset()<getStandardTimezoneOffset(e)}document.addEventListener("ec_unit_changed",(function(){var e=document.getElementById("br-result");e&&""!==e.innerHTML&&beginEnd();var t=document.getElementById("hf-result");t&&t.textContent.trim()&&HumanToEpochTZ("hex"===t.dataset.outputType?"hex":void 0)})),document.addEventListener("DOMContentLoaded",(function(){selectInitialInputValue("#hextime")}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.