atmosphere explorer pds.ls
tool typescript atproto
Something went wrong. Try again.
1234567891011121314export const formatFileSize = (bytes: number): string => { if (bytes === 0) return "0 B"; const k = 1024; const sizes = ["B", "KiB", "MiB", "GiB"]; const i = Math.floor(Math.log(bytes) / Math.log(k)); return `${(bytes / Math.pow(k, i)).toFixed(i === 0 ? 0 : 1)} ${sizes[i]}`;};
export const localDateFromTimestamp = (timestamp: number) => new Date(timestamp - new Date().getTimezoneOffset() * 60 * 1000) .toISOString() .split(".")[0] .replace("T", " ");