Files
post-self.ink/content/extras/systime.md
Madison Rye Progress 3277c52b17 Add holiday/shabbat
2025-10-06 00:36:20 -07:00

2.3 KiB

title
title
Systime
<style> .systime-form { text-align: center; } .systime-form input { font-family: Gotu, sans-serif; font-size: 20pt; margin: 0.5rem 0; text-align: center; } #output { font-color: #eaa; } </style>

You can use this form to convert to/from systime. This also includes dates in the Hebrew calendar, given their use in a few Post-Self projects.






<script type="text/javascript"> document.getElementById('convertSystime').addEventListener("click", (ev) => { fetch(`https://systime.post-self.ink/api/1/systime/${document.getElementById('systime').value}`) .then((response) => { if (!response.ok) { document.getElementById('output').innerHTML = `Error converting systime`; throw new Error(response.status); } return response.json(); }) .then(display); }); document.getElementById('convertDate').addEventListener("click", (ev) => { fetch(`https://systime.post-self.ink/api/1/date/${document.getElementById('date').value}`) .then((response) => { if (!response.ok) { document.getElementById('output').innerHTML = `Error converting date`; throw new Error(response.status); } return response.json(); }) .then(display); }); function display(json) { document.getElementById('output').innerHTML = ``; document.getElementById('systime').value = json.systime.string; document.getElementById('date').value = json.gregorian.string; document.getElementById('hebrew').value = json.hebrew.string + (json.hebrew.holiday !== null ? ' — ' + json.hebrew.holiday : '') + (json.hebrew.shabbat ? ' (Shabbat)' : ''); } </script>