Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
swatch_time [2025/05/11 18:03] – created gardeniaswatch_time [2025/06/17 20:58] (current) – old revision restored (2025/06/17 20:57) GlitchyZorua
Line 1: Line 1:
-<!DOCTYPE html> +====== Swatch Internet Time / .beat Time ====== 
-<html> +<fs xx-large>#beatTime#</fs>
-<html lang="en-US"> +
-  <head>  +
-    <meta charset="UTF-8"> +
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">+
  
-    <title>millennium layout</title> +===== Introduction ===== 
-    <link rel="icon" type="image/x-icon" href="https://i.postimg.cc/ZR2SpzKq/pillico.png">+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 :^)
  
-    <link href="millenniumlayout.css" rel="stylesheet" type="text/css" media="all"> +It was originally invented by the Swatch Company in 1998 (Sorta since they copied it from a time format used in the French Revolution) although it did not gain much widespread popularity - however, it's used on MelonLand and many other web revival sites as a standard means of organisation and planning!
-<link rel="preconnect" href="https://fonts.upset.dev"> +
-<link href="https://fonts.upset.dev/css2?family=WindSong:wght@400;500&family=Zen+Kaku+Gothic+Antique&display=swap" rel="stylesheet"> +
-  </head> +
-  <body> +
  
-<!-- The header image is 700 x 480 pixels. You can change the size in CSS, and change the image itself here. --> +===== How does it work? =====
-<div id="header"><img src="https://i.postimg.cc/gk9p0pTS/chii.png"></div>+
  
-<h1>millennium.</h1>+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.
  
-<div class="container">+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**
  
-<!-- This is the left sidebar--> +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!
-<div class="sidebar">+
  
-<h3>About me</h3> +===== How can I use swatch time in my life? =====
-<div class="sidebarbox"> +
-<img src="https://i.postimg.cc/Df4FF0B4/icon.png" id="profilepic"> +
-<p> +
-<b>Name:</b> JJJ<br> +
-<b>Age:</b> 55<br> +
-<b>Pronouns:</b> he/him<br> +
-<b>Likes:</b> pictures of spiderman<br> +
-<b>Favorite food:</b> cigars +
-</p> +
-</div>+
  
-<h3>Listening</h3> +Easy; just use swatch time when you are planning your events or meetups and get your friends to do the same! There are even some apps that can help you!
-<div class="music marquee"> +
-<span> +
-<img src="https://i.postimg.cc/52gWpCNT/a-audio.gif">can't decide - scissor sisters +
-</span> +
-</div>+
  
-<h3>Updates</h3> +**Swatch Time Apps for various platforms:** 
-<div class="sidebarbox">+  * All Apple devices, including Apple Watch - [[https://beattime.mulot.org/|BeatTime]] 
 +  * Android Phones - [[https://f-droid.org/en/packages/eu.mirkodi.swatchbeatclock/index.html|Swatch .beat clock]], [[https://play.google.com/store/apps/details?id=xyz.poolp.swatchtime|Swatch Time]] 
 +  * Pebble Smart Watches - [[https://apps.rebble.io/en_US/search/watchfaces/1?native=false&query=beat|See Beat apps]] 
 +  * macOS Menubar - [[https://github.com/amiantos/dotbeat|dotbeat]] 
 +  * GNOME Extension - [[https://extensions.gnome.org/extension/5946/swatch-clock/|Swatch Clock]] 
 +  * Cinnamon Applet - [[https://cinnamon-spices.linuxmint.com/applets/view/310|Internet Time]] 
 +  * Win 95/XP - [[https://web.archive.org/web/20081224143907/http://www.artefakt.com/projects/ibeat/|iBeat]], Works with Wine and OS's running Windows 7+ as well, not guaranteed to work in the year 2038 
 +  * Winamp & WaCUP - [[https://getwacup.com/plugins/big_clock/|Big Clock]], Comes bundled with every copy of WaCUP (and Winamp, I think?), Right click on the big clock, then click on .beat time 
 +  * iPad - [[https://apps.apple.com/us/app/beat-internet-time/id1570173118|Beat: Internet time]] 
 +  * Color - [[rgbeat|RGBeat]], changes color depending on what time it is, in beat; [[https://melonking.net/hidden/rgbeat|Melon]], [[https://unnick.mice.tel/rgbeat/|Unick]]
  
-<ul> +===== Other useful links! =====
-<li>11.10.2024: New layout.</li> +
-<li>4.15.2009: Became mayor of New York City.</li> +
-<li>6.16.2004: Got sued by She-Hulk.</li> +
-<li>11.13.2003: Published a book.</li> +
-<li>11.25.1998: Died and went to hell.</li> +
-<li>3.11.1965: Captured Spiderman with evil robots.</li> +
-<li>12.10.1962: Son went to space. (He's an astronaut)</li> +
-</ul>+
  
-</div>+  * Swatch time [[https://forum.melonland.net/index.php?topic=1202.0|discussion thread]] on our forum! 
 +  * The Swatch [[https://www.swatch.com/en-en/internet-time.html|intro video from 1998]] 
 +  * Swatch Time History on [[https://en.wikipedia.org/wiki/Swatch_Internet_Time|Wikipedia]] 
 +  * Decimal Time on Wikipedia [[https://en.wikipedia.org/wiki/Decimal_time]]
  
-<h3>Visitors</h3> +----
-<!-- Start of CuterCounter Code --+
-<a href="https://www.cutercounter.com/" target="_blank"><img src="https://www.cutercounter.com/hits.php?id=huvxqkqxq&nd=6&style=2" alt="website counter"></a> +
-<!-- End of CuterCounter Code --> +
-</div> +
-<!-- That's the end of the left sidebar.-->+
  
-<!-- This is the main middle box! --> +===== Code Snippets ===== 
-<div class="main"> +You can also include a swatch clock on your website; here are some premade code snippets you can use!
-<h2>Welcome.</h2>+
  
-<p>This is the "Millennium" layout, designed in the vein of 00s layouts. It is small and cluttered, with a huge header image. It has a precise and busy kind of feeling to it, I think.</p> +==== JavaScript: ====
-<p>The calendar in the sidebar uses javascript, nothing else does!</p>+
  
-<ul> +**JavaScript - Easy Option**
-<li>This is a list. It's got a custom bullet point.</li> +
-<li>Some ideas for pages on your web site:</li> +
-<ul> +
-<li>display some of your favorite pictures you have on your computer</li> +
-<li>share your bookmarked sites</li> +
-<li>write down instructions for how to do something you're pretty good at doing</li> +
-</ul> +
-<li>Or nothing at all. Do what you want.</li> +
-</ul>+
  
-<p><b>This is bolded.</b> <i>This is italicized.</i> <u>This is underlined.</u> <a href="http://www.neocities.org">This is a link.</a></p>+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="swatchClock">@000</span> 
 +<script defer src="https://melonking.net/scripts/swatchTime.js"></script> 
 +</code>
  
-<h2>Notes</h2>+**JavaScript - Full Code** 
 +<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; 
 +    // time in seconds 
 +    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 / millisecondsInABeat).toFixed(2); 
 +    } else { 
 +        return Math.floor(Math.abs(timeInMilliseconds / millisecondsInABeat)); 
 +    } 
 +
 +</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. 
 +<code> 
 +<span id="mySwatchClock"></span> 
 +<script> 
 +    var mySwatchClock = document.getElementById('mySwatchClock'); 
 +    function updateSwatchClock() { 
 +        mySwatchClock.innerHTML = '@' + GetSwatchTime(); 
 +    } 
 +    setInterval(updateSwatchClock, 864); 
 +</script> 
 +</code>
  
-<p>Click on the counter to get one for your page. This one's counting for this page. It's customizable!</p> +==== PHP: ====
-</div>+
  
-<!-- This is the right sidebar! --> +PHP has native support for Swatch time, you can get the latest beat using this snippet: 
-<div class="sidebar"> +<code>$swatchTime = date('B'); //000-999</code>
-<h3>Today</h3> +
-<!--This is the code for the calendar.--> +
-<div class="calendar-container"> +
-    <header class="calendar-header"> +
-         <p class="calendar-current-date"></p> +
-    </header>+
  
-    <div class="calendar-body"> +However if you would like a full function that also shows microbeats, we have that too! 
-        <ul class="calendar-dates"></ul+<code> 
-    </div> +// Returns the current Swatch beat 
-<script src="calendarsscript.js"></script> +function GetSwatchTime($showDecimals true) 
-</div> +
-<!--Now the calendar is over.-->+    // Get time in UTC+1 (Do not Change!) 
 +    $now = new DateTime("now", new DateTimeZone("UTC")); 
 +    $now->add(new DateInterval("PT1H")); 
 +    // Calculate the seconds since midnight e.g. time of day in seconds 
 +    $midnight = clone $now; 
 +    $midnight->setTime(0, 0); 
 +    $seconds $now->getTimestamp() - $midnight->getTimestamp(); 
 +    // 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), 2), 2); 
 +    } else { 
 +        return floor(abs($seconds / $swatchBeatInSeconds)); 
 +    } 
 +} 
 +</code>
  
-<h3>Navigation</h3> +==== BASH: ==== 
-<div class="sidebarbox"> +(note that Etc timezones are inverted) 
-<ul> +Calculating Beat Time in bash is simple: 
-<li><a href="">Link</a></li> +<code
-<li><a href="">Link</a></li+MIDNIGHT=$( TZ='Etc/GMT-1' date -d "12:00 am+%s ) 
-<li><a href="">Link</a></li> +BTIME=$(( (($EPOCHSECONDS - $midnight) * 1000)  86400 )) 
-<li><a href="">Link</a></li> +echo @$BTIME 
-<li><a href="">Link</a></li> +</code
-</ul+However, you need to use an external program to calculate centibeats, since bash does not handle decimals well:
-</div>+
  
-<h3>Contact</h3+(using dc, which is a rpn calculator) 
-<div class="sidebarbox"+<code
-<p>Socials</p> +MIDNIGHT=$( TZ='Etc/GMT-1 date -d "12:00 am+%s )
-<p>email@email.com</p> +
-<p>discordname @ discord</p></div>+
  
 +printf @
 +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, you can use any program that uses piped input, but lemonbar is the easiest to use:
 +<code>
 +while true
 +do
 +  MIDNIGHT=$( TZ='Etc/GMT-1' date -d "12:00 am" +%s )
 +  BTIME=$(( (($EPOCHSECONDS - $midnight) * 1000)  / 86400 ))
 +  echo @$BTIME
 +done | lemonbar -bg 48+0+18  # positions a little above the bottom left
 +</code>
 +(you can replace the code between the do and done with the dc version too)
  
-<h3>Link back</h3> 
-<div class="sidebarbox"> 
-<!--Replace this with your button!--> 
-<img src="https://i.postimg.cc/yxRzTpky/lorenribozonebutton2.png" alt="XIXXII website button"> 
-</div> 
- 
-<!--If you want more sidebar boxes, just add more of these:--> 
-<h3>Boxname</h3> 
-<div class="sidebarbox"><p>Box content.</p></div> 
- 
-</div> 
-<!--That's the end of the right sidebar.--> 
- 
- 
-</div> 
-<!--This is the end of the main "container" that holds the sidebars and middle body.--> 
- 
-<!--Here's the footer.--> 
-<div class="footer"> 
-<p>Layout anticopyright: please do copy, modify, adapt, transform, and redistribute. Delete or change whatever you want.</p> 
-</div> 
- 
-</body> 
-</html>