Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
swatch_time [2025/05/11 17:58] – gardenia | swatch_time [2025/06/17 20:58] (current) – old revision restored (2025/06/17 20:57) GlitchyZorua | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <!-- (c) Layout created by 𝓯𝓻𝓮𝓪𝓴𝔂 | + | ====== Swatch Internet Time / .beat Time ====== |
+ | <fs xx-large>#beatTime#</fs> | ||
+ | ===== Introduction ===== | ||
+ | Swatch time is a universal standard time for the entire internet! It lets you plan events or meetups with your friends from anywhere in the world and not have to worry about timezones or other annoyances! Its also hella hacker and very cool to use :^) | ||
- | < | + | It was originally invented by the Swatch Company |
- | < | + | |
- | <!-- (c) Layout created by C4Lv1n (calvin) (https:// | + | |
- | <div style=" | + | |
- | <img src=" | + | |
- | <img src=" | + | |
- | <img src=" | + | ===== How does it work? ===== |
- | <img src=" | + | It divides the day into 1000 “**beats**”. Instead of using hours, minutes, and seconds to represent time, Swatch Internet Time uses a single decimal number ranging from 000 to 999. Each beat is equivalent to 1 minute and 26.4 seconds. Sometimes you'll also see some extra numbers like ".56" that are microbeats and are similar to seconds. |
- | <img src=" | + | Swatch time is usually preceded by an **@** symbol; this helps you know it's swatch time and not some random number! For example **@123** or **@542.69** |
- | <iframe width=" | + | 000 in Swatch time is the same as Midnight UTC+1; but because swatch time does not use timezones, midnight will be different for everyone. The goal of swatch time is not to provide the relative time you can use in your daily life; it's for worldwide events that all need to happen at the same time! |
- | </ | + | |
- | <img src="& | + | |
- | < | + | |
- | .general-about{ | + | |
- | position: relative; | + | |
- | margin-top: 30px; | + | |
- | } | + | |
- | .general-about .profile-pic:: | + | |
- | content: ''; | + | |
- | background: url(' | + | |
- | background-size: | + | |
- | display: block; | + | |
- | width: 200px; | + | |
- | height: 100px; | + | |
- | z-index: 999; | + | |
- | position: absolute; | + | |
- | top: -22px; | + | |
- | left: 108px; | + | |
- | } | + | |
- | </ | + | |
+ | ===== How can I use swatch time in my life? ===== | ||
- | < | + | Easy; just use swatch time when you are planning your events or meetups and get your friends |
- | @keyframes flying-santa{ | + | |
- | from{ left:-400px; } | + | |
- | to{ left: | + | |
- | } | + | |
- | #santa{ | + | |
- | position: fixed; | + | |
- | left: -400px; | + | |
- | bottom: 100px; | + | |
- | width: 130px; | + | |
- | animation: flying-santa 5s infinite linear; | + | |
- | pointer-events: | + | |
- | } | + | |
- | </ | + | |
- | <img id=" | + | |
- | <img src=" | + | |
- | <img src=" | + | |
- | <img src="http://dl9.glitter-graphics.net/pub/1522/1522099uao2whdyo3.gif"/> | + | **Swatch Time Apps for various platforms: |
+ | * All Apple devices, including Apple Watch - [[https:// | ||
+ | * Android Phones - [[https:// | ||
+ | * Pebble Smart Watches - [[https:// | ||
+ | * macOS Menubar - [[https:// | ||
+ | * GNOME Extension - [[https:// | ||
+ | * Cinnamon Applet - [[https:// | ||
+ | * Win 95/XP - [[https:// | ||
+ | * Winamp & WaCUP - [[https:// | ||
+ | * iPad - [[https:// | ||
+ | * Color - [[rgbeat|RGBeat]], | ||
- | <img src=" | + | ===== Other useful links! ===== |
- | <img src="https://i10.glitter-graphics.org/pub/1723/1723090nc76dbqt86.jpg" alt=" | + | * Swatch time [[https:// |
+ | * The Swatch [[https://www.swatch.com/ | ||
+ | * Swatch Time History on [[https:// | ||
+ | * Decimal Time on Wikipedia [[https://en.wikipedia.org/ | ||
+ | ---- | ||
- | < | + | ===== Code Snippets ===== |
+ | You can also include a swatch clock on your website; here are some premade code snippets you can use! | ||
- | li.active .icon { content:url(' | + | ==== JavaScript: ==== |
- | </ | + | **JavaScript - Easy Option** |
- | <style> | + | Here is a premade JavaScript clock for your website! Just paste this code onto your page wherever you want your clock to be and it will work! |
+ | <code> | ||
+ | <span id=" | ||
+ | <script defer src=" | ||
+ | </code> | ||
- | .online{content:url("https://i10.glitter-graphics.org/pub/2701/2701700nm59bd6ka4.gif");} | + | **JavaScript - Full Code** |
+ | < | ||
+ | // Returns the current Swatch beat | ||
+ | function GetSwatchTime(showDecimals = true) { | ||
+ | // get date in UTC/GMT | ||
+ | var date = new Date(); | ||
+ | var hours = date.getUTCHours(); | ||
+ | var minutes = date.getUTCMinutes(); | ||
+ | var seconds = date.getUTCSeconds(); | ||
+ | var milliseconds = date.getUTCMilliseconds(); | ||
+ | // add hour to get time in Switzerland | ||
+ | hours = hours == 23 ? 0 : hours + 1; | ||
+ | | ||
+ | var timeInMilliseconds = ((hours * 60 + minutes) * 60 + seconds) * 1000 + milliseconds; | ||
+ | // there are 86.4 seconds in a beat | ||
+ | var millisecondsInABeat = 86400; | ||
+ | // calculate beats to two decimal places | ||
+ | if (showDecimals) { | ||
+ | return Math.abs(timeInMilliseconds | ||
+ | } else { | ||
+ | return Math.floor(Math.abs(timeInMilliseconds | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | If you want it to display on your webpage and auto-update here is an example - first, we make a **span** with an id, this is where the clock will appear on your page - then we get that span in a script, make a function that fills it with the swatch time, and finally, we set it to reload every microbeat. | ||
+ | < | ||
+ | <span id="mySwatchClock"></ | ||
+ | < | ||
+ | var mySwatchClock = document.getElementById(' | ||
+ | function updateSwatchClock() { | ||
+ | mySwatchClock.innerHTML = ' | ||
+ | | ||
+ | setInterval(updateSwatchClock, | ||
+ | </ | ||
+ | </ | ||
- | </ | + | ==== PHP: ==== |
- | <style> | + | PHP has native support for Swatch time, you can get the latest beat using this snippet: |
+ | <code> | ||
+ | |||
+ | However if you would like a full function that also shows microbeats, we have that too! | ||
+ | < | ||
+ | // Returns the current Swatch beat | ||
+ | function GetSwatchTime($showDecimals = true) | ||
+ | { | ||
+ | // Get time in UTC+1 (Do not Change!) | ||
+ | $now = new DateTime(" | ||
+ | $now-> | ||
+ | // Calculate the seconds since midnight e.g. time of day in seconds | ||
+ | $midnight = clone $now; | ||
+ | $midnight-> | ||
+ | $seconds = $now-> | ||
+ | // Swatch beats in seconds - DO NOT CHANGE | ||
+ | $swatchBeatInSeconds = 86.4; | ||
+ | // Calculate beats to two decimal places | ||
+ | if ($showDecimals) { | ||
+ | return number_format(round(abs($seconds / $swatchBeatInSeconds), | ||
+ | } else { | ||
+ | return floor(abs($seconds / $swatchBeatInSeconds)); | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
- | .online{content:url("https:// | + | ==== BASH: ==== |
+ | (note that Etc timezones are inverted) | ||
+ | Calculating Beat Time in bash is simple: | ||
+ | < | ||
+ | MIDNIGHT=$( TZ=' | ||
+ | BTIME=$(( (($EPOCHSECONDS - $midnight) * 1000) / 86400 )) | ||
+ | echo @$BTIME | ||
+ | </ | ||
+ | However, you need to use an external program to calculate centibeats, since bash does not handle decimals well: | ||
- | </style> | + | (using dc, which is a rpn calculator) |
+ | <code> | ||
+ | MIDNIGHT=$( TZ=' | ||
- | <img src=" | + | printf @ |
- | <img src="https:// | + | dc << EOF |
+ | # setting precision | ||
+ | 2 k | ||
+ | # subtracting midnight from the current epoch | ||
+ | $EPOCHREALTIME $MIDNIGHT | ||
+ | # converting to ms | ||
+ | 1000 * | ||
+ | # divide by seconds in a day | ||
+ | 86400 / | ||
+ | # print it to screen | ||
+ | p | ||
+ | EOF | ||
+ | </code> | ||
+ | To display it on your screen permanently, | ||
+ | <code> | ||
+ | while true | ||
+ | do | ||
+ | MIDNIGHT=$( TZ=' | ||
+ | BTIME=$(( (($EPOCHSECONDS - $midnight) * 1000) | ||
+ | echo @$BTIME | ||
+ | done | lemonbar | ||
+ | </code> | ||
+ | (you can replace the code between the do and done with the dc version too) | ||