Login
7 branches 0 tags
Ben (X13/Arch) Moved datetime λs into a built-in module 791f655 3 years ago 716 Commits
nujel / stdlib_modules / time.nuj
;; Nujel - Copyright (C) 2020-2021 - Benjamin Vincent Schulenburg
;; This project uses the MIT license, a copy should be included under /LICENSE
;;
;; Time related λs
[defmodule :time

[export seconds [defn seconds [timestamp]
      "Return the seconds part of TIMESTAMP, defaults to current time"
      [rem [or timestamp [time]] 60]]]

[export minutes [defn minutes [timestamp]
      "Return the minutes part of TIMESTAMP, defaults to current time"
      [rem [/ [or timestamp [time]] 60] 60]]]

[export hours [defn hours [timestamp]
      "Return the hours part of TIMESTAMP, defaults to current time"
      [rem [/ [or timestamp [time]] 3600] 24]]]

]