A lightweight assistive toolset for UK time on Roblox. Given a Unix timestamp (in seconds), it tells you whether the UK is on British Summer Time (UTC+1), converts the stamp into a UK-local date table, and formats it as a date, time or clock string — automatically applying GMT/BST where the UK uses them.
Roblox servers run on UTC, so os.date alone never tells you what the clock says in London. This package computes the UK offset (0 in winter, +1h during BST) for any given moment and applies it, so your UK time is always correct — including across DST boundaries.
yarn add @nrbx/uk-timestamp-helper
npm install @nrbx/uk-timestamp-helper
pnpm add @nrbx/uk-timestamp-helperThen add the following to your Rojo project file, under your node_modules configuration.
"node_modules": {
"$className": "Folder",
"@rbxts": {
"$path": "node_modules/@rbxts"
},
"@nrbx": {
"$path": "node_modules/@nrbx"
}
}And this to your tsconfig.json
"typeRoots": ["node_modules/@rbxts", "node_modules/@nrbx"],Every function takes a Unix timestamp in seconds (the unit used by os.time()). Pass os.time() for "now".
import {
formatUKTime,
formatUKDate,
formatUKClock,
ukOffsetHours,
} from "@nrbx/uk-timestamp-helper";
const now = os.time();
print(ukOffsetHours(now)); // 1 during BST, 0 during GMT
print(formatUKDate(now)); // "08/08/2026"
print(formatUKTime(now)); // "2026-08-08 15:30:00"
print(formatUKClock(now, true)); // "15:30" (24h)
print(formatUKClock(now, false)); // "3:30 PM" (12h)isBST returns whether the UK is on British Summer Time (UTC+1) at the given moment. DST starts at 01:00 UTC on the last Sunday of March and ends at 01:00 UTC on the last Sunday of October.
import { isBST } from "@nrbx/uk-timestamp-helper";
isBST(os.time()); // false in winter, true in summerukOffsetHours is the UK's offset from UTC in hours — 1 during BST, 0 during GMT.
import { ukOffsetHours } from "@nrbx/uk-timestamp-helper";
const offset = ukOffsetHours(os.time()); // 0 or 1ukDateTable converts a Unix stamp into a UK-local UKDateTable with year, month, day, hour, min, sec and wday (1 = Sunday). Use it directly, or read the UK clock from it:
import { ukDateTable } from "@nrbx/uk-timestamp-helper";
const t = ukDateTable(os.time());
print(t.hour, t.min); // UK local clockukTimeParts returns just the UK local clock as { hour, min }:
import { ukTimeParts } from "@nrbx/uk-timestamp-helper";
const { hour, min } = ukTimeParts(os.time());
print(`${hour}:${min}`); // UK local "15:30"formatUKTime gives the full UK date-time ("2026-08-08 15:30:00"), formatUKDate the UK date ("08/08/2026", day/month/year), and formatUKClock just the clock — 24h ("15:30") or 12h with AM/PM ("3:30 PM"):
import { formatUKTime, formatUKDate, formatUKClock } from "@nrbx/uk-timestamp-helper";
const now = os.time();
print(formatUKTime(now)); // "2026-08-08 15:30:00"
print(formatUKDate(now)); // "08/08/2026"
print(formatUKClock(now, true)); // "15:30"
print(formatUKClock(now, false)); // "3:30 PM"All functions accept a Unix timestamp in seconds.
isBST(unixStamp: number): booleanWhether the UK is on British Summer Time (UTC+1) at unixStamp.
ukOffsetHours(unixStamp: number): numberThe UK offset from UTC in hours (0 for GMT, 1 for BST) at unixStamp.
ukDateTable(unixStamp: number): UKDateTableThe UK-local date table for unixStamp.
interface UKDateTable {
year: number;
month: number;
day: number;
hour: number;
min: number;
sec: number;
wday: number; // 1 = Sunday … 7 = Saturday
}ukTimeParts(unixStamp: number): { hour: number; min: number }The UK local clock (hour/minute) for unixStamp.
formatUKTime(unixStamp: number): stringThe UK local date-time as "YYYY-MM-DD HH:MM:SS", e.g. "2026-08-08 15:30:00".
formatUKDate(unixStamp: number): stringThe UK local date as "DD/MM/YYYY" (day/month/year), e.g. "08/08/2026".
formatUKClock(unixStamp: number, use24h: boolean): stringThe UK local clock. use24h: true → "HH:MM" (e.g. "15:30"); use24h: false → "H:MM AM/PM" (e.g. "3:30 PM").
# Install dependencies
yarn install
# Compile with roblox-ts
yarn build
# Watch mode
yarn watch
# Lint + format with Biome
yarn biomeMIT
