All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login
's Avatar

f97

Joined 1747997634

Recently created
Least recently created
Recently updated
Least recently updated
All gists 1
f97's Avatar

f97 / timezonedb-fix.js

0 likes
0 forks
4 files
Last active 1751449070
1 try {
2 let body = JSON.parse($response.body);
3 const secondsToSubtract = 60 * 60 * 24 * 18200; // ~49.86 năm
4 const now = Math.floor(Date.now() / 1000);
5
6 if (body?.timestamp) {
7 body.timestamp = Number(now ?? body.timestamp) - secondsToSubtract;
8 }
9 $done({ body: JSON.stringify(body) });
10 } catch (e) {
Newer Older

Powered by Opengist ⋅ Load: 34ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ Discord