Skip to content

Date Object

GodDragoner edited this page May 17, 2018 · 2 revisions

Methods

date::before(TeaseDate date) Returns whether this date is set to a date before the date given

date::after(TeaseDate date) Returns whether this date is set to a time after the date given

date::sameDay(TeaseDate date) Returns whether both dates are set to the same day (no matter the hours, minutes etc.)

date::hasPassed() Returns whether this date has already passed

Okay, I get it but still I want an example

        if (!getDate(VARIABLE_NEXT_PUNISHMENT_DAY).sameDay(setDate())) {
            sendMessage("You've been skipping punishment day %SlaveName%!");
        }

        //Set the date to the next thursday (today is thursday)
        setDate(VARIABLE_NEXT_PUNISHMENT_DAY).addDay(7).setHour(0).setMinute(0).setSecond(0));

Clone this wiki locally