Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time not updating #31

Open
amd044 opened this issue Aug 6, 2024 · 1 comment
Open

Time not updating #31

amd044 opened this issue Aug 6, 2024 · 1 comment

Comments

@amd044
Copy link

amd044 commented Aug 6, 2024

I got everything to work except for the time. I see that you can enter in a fixed time, but how can you make it so that it automatically updates and is in sync with your time zone? Please post code for EST. Thank you!

@KleynArt
Copy link

KleynArt commented Oct 16, 2024

Here I leave you the fixed code, bro!


<script src="https://code.jquery.com/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
    body { 
        background-color: rgba(0, 0, 0, 0); 
        margin: 0px auto; 
        overflow: hidden; 
        font-family: instruction, monospace;
        font-size: 13px;
        color: #AFAFAF;
    }
    .Blink {
        animation: blinker 1.5s cubic-bezier(.5, 0, 1, 1) infinite alternate;  
    }
    @keyframes blinker {  
        from { opacity: 1; }
        to { opacity: 0; }
    }
    .top-right {
        float: right;
        width: auto;
        text-align: right;
    }
    .top-right-container {
        float: right;
        width: auto;
        text-align: right;
        background-color: rgba(0,0,0,0.5);
        padding: 5px;
        margin: 10px;
        border-radius: 10px;
    }
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>XION Bodycam Overlay</title>
REC   AXON BODYCAM™  
XXX [000]  
XXX  
00 XXX 0000 00:00:00 UTC  
<script> //***edit this only for your information*** const player = "Kleyn Kojima"; const agency = " LSPD [Sub-Comisario]"; const callsign = "[0002]"; //*** end edit this only *** const monthNames = ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]; function init(){ clock(); document.getElementById("player").innerHTML = player; document.getElementById("agency").innerHTML = agency; document.getElementById("callsign").innerHTML = callsign; }; function clock(){ var d=new Date(); updateTime(d); updateDate(d); setTimeout(clock, 1000); }; function updateDate(dt){ var day = dt.getDate(); var month = monthNames[dt.getMonth()]; var year = dt.getFullYear(); var d_str = day + " " + month + " " + year; document.getElementById('date-span').innerHTML = d_str; }; function updateTime(dt){ var h = dt.getHours().toString(); var m = dt.getMinutes().toString(); var s = dt.getSeconds().toString(); h = h.length == 1 ? '0' + h : h; m = m.length == 1 ? '0' + m : m; s = s.length == 1 ? '0' + s : s; var t_str = h + ":" + m + ":" + s; document.getElementById('time-span').innerHTML = t_str; }; window.onload = init; </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants