EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

✨ EMILUA(3em) β€” Emilua, the Lua execution engine ✨

okay bestie, welcome to the manual page for Emilua β€” the Lua execution engine β€” and we’re about to make file-time clocks make sense. πŸ’–

🌸 NAME 🌸

Emilua β€” Lua execution engine.

πŸ¦‹ DESCRIPTION πŸ¦‹

Start here, bestie:

local clock = require('filesystem').clock

This is a clock for representing file time. Its epoch is unspecified. That’s the whole vibe: it’s a clock, it does file-time things, and you should not assume a specific epoch. periodt. 🫢

✨ FUNCTIONS ✨

now() β†’ clock.time_point

Hands you a brand-new time point representing the clock’s current value. ⏰

epoch() β†’ clock.time_point

Hands you a new time point representing the clock’s epoch. πŸŽ€

unix_epoch() β†’ clock.time_point

Hands you a new time point representing 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970. The classic. 🌈

from_system(tp: time.system_clock.time_point) β†’ clock.time_point

Converts tp into a clock.time_point that represents the same point in time. Same moment, different clock outfit. πŸ’…

🧚 time_point FUNCTIONS 🧚

add(self, secs: number)

Changes the time point by the given duration.

Note β€” When that duration gets converted into the clock’s native tick representation, it’ll round to the nearest time point, and halfway cases round to even. No cap, that detail matters. 😭

sub(self, secs: number)

Changes the time point by the given duration.

Note β€” When that duration gets converted into the clock’s native tick representation, it’ll round to the nearest time point, and halfway cases round to even. Same rounding rules, same energy. πŸ’€

to_system(self) β†’ time.system_clock.time_point

Converts self into a time.system_clock.time_point that represents the same point in time. ✨

πŸ‘‘ time_point PROPERTIES πŸ‘‘

seconds_since_epoch: number

How many seconds have elapsed since the clock’s epoch, as a number. πŸ•°οΈ

seconds_since_unix_epoch: number

How many seconds have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, as a number. 🌍

πŸ’œ time_point METAMETHODS πŸ’œ

The metamethods this time point supports are:

  • __add()
  • __sub()
  • __eq()
  • __lt()
  • __le()

mwah πŸ’‹ β€” this page is from Emilua 0.12.1-nixpkgs1, dated 1980-01-01. bye bestie 🫢

πŸ“¦ where this page comes from