HyperScript
Docs

← All of the Docs Working with values

Dates and times

expressionnowsince 1.7.0

The present moment · set {%player%.joined} to now

set {%player%.next_daily} to now + 1 day
Try it
expressiontoday / tomorrowsince 1.7.0

Midnight at the start of today, or of tomorrow · if {%player%.voted} < today:

if {%player%.last_vote} < today:
    send "&eYou have not voted today."
Try it
expression<date> + <duration> / <date> - <duration>since 1.7.0

A later or an earlier date · now + 7 days

set {%player%.next_daily} to now + 1 day
Try it
expression<date> - <date>since 1.7.0

The time between them, as a duration · now - {%player%.joined}

send "&7 - &f%{_name}%"
Try it
expressiontime since <date>since 1.7.0

How long ago it was · time since {%player%.last_death}

set {_ago} to time since {%player%.last_death}
send "&7You last died %{_ago}% ago."
Try it
expressiontime until <date>since 1.7.0

How long until then; zero if it has passed · time until {event_start}

set {_left} to time until {%player%.next_daily}
Try it
expression<date> formatted as <pattern>since 1.7.0

The date written out your way · now formatted as "d MMMM yyyy"

send "&aSee you again on " + ({%player%.next_daily} formatted as "EEEE 'at' HH:mm")
Try it
expressionfirst join date of <who> / last seen of <who>since 1.7.0

When a player first joined and was last on; works offline · last seen of arg.1

set {_seen} to last seen of arg.1
send "&7%arg.1% was last on: &f%{_seen}%"
Try it
Guide and examples

now is the present moment as a value. It can be stored, compared, and moved forward or back with a duration.

command /daily:
    trigger:
        if {%player%.next_daily} is set and now < {%player%.next_daily}:
            set {_left} to time until {%player%.next_daily}
            send "&cCome back in %{_left}%."
            stop
        set {%player%.next_daily} to now + 1 day
        give 3 diamond to player
        send "&aSee you again on " + ({%player%.next_daily} formatted as "EEEE 'at' HH:mm")
SyntaxResultExample
nowThe present momentset {%player%.joined} to now
today / tomorrowMidnight at the start of today, or of tomorrowif {%player%.voted} < today:
<date> + <duration> / <date> - <duration>A later or an earlier datenow + 7 days
<date> - <date>The time between them, as a durationnow - {%player%.joined}
time since <date>How long ago it wastime since {%player%.last_death}
time until <date>How long until then; zero if it has passedtime until {event_start}
<date> formatted as <pattern>The date written out your waynow formatted as "d MMMM yyyy"
first join date of <who> / last seen of <who>When a player first joined and was last on; works offlinelast seen of arg.1
  • A date prints as 11 October 2026 18:30 unless you format it. The letters for formatted as are Java's: yyyy year, MM month number, MMMM month name, d day, EEEE weekday, HH hour, mm minute, ss second. Text inside single quotes is taken as it is.
  • Dates compare with < and >, and can be saved in variables like any other value.
  • In arithmetic with plain numbers a date counts as seconds since 1970, the same scale as server.time, so the two mix: now > server.time - 60.
  • Times follow the clock of the machine the server runs on.

Another place's clock. <date> formatted as "<pattern>" in time zone "<zone>" writes a moment as the clock shows it somewhere else: now formatted as "HH:mm" in time zone "Europe/Berlin". The zone is one of the world's names for them, such as "America/New_York", "Asia/Tokyo" or "UTC".