CountDown.tilldate()#

classmethod CountDown.tilldate(year: Optional[int] = None, month: Optional[int] = None, day: Optional[int] = None, hour: Optional[int] = None, minute: Optional[int] = None, second: Optional[int] = None, **kwargs)[source]#

Alternative constructor for a countdown targeted at a specific date.

Parameters
  • year – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • month – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • day – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • hour – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • minute – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • second – Time units, all integers. Cannot have leading zeroes. It is fine to specific only, for example, the year and the month. The arguments will be passed on to datetime.datetime to construct a time object.

  • **kwargs – Further keyword arguments are passed on to the ordinary constructor, see CountDown.

Examples

Countdown running until a certain datetime is reached:

import alfred3 as al
exp = al.Experiment()

@exp.member
class Demo(al.Page):
    def on_exp_access(self):
        self += al.CounDown.tilldate(
            year=2031,
            month=1,
            day=31,
            hour=12,
            minute=30,
            second=12,
            font_size="big",
            align="center"
            )