DateTime class month property

This page explains the DateTime class’s month property interface.

What interface is this?

The month property gets or sets a month’s value.

Basic usage

A DateTime instance has its property interface.

Its getter interface returns a month’s Int value.

import apysc as ap

ap.Stage()
datetime_: ap.DateTime = ap.DateTime(year=2022, month=12, day=1)
assert datetime_.month == 12

Also, its setter interface accepts a month’s Int value.

1-12 integer is acceptable.

import apysc as ap

ap.Stage()
datetime_: ap.DateTime = ap.DateTime(year=2022, month=12, day=1)
datetime_.month = ap.Int(1)
assert datetime_.month == 1

month property API

Note: the document build script generates and updates this API document section automatically. Maybe this section is duplicated compared with previous sections.

[Interface summary]

Get a current month’s value.


[Returns]

  • month: Int

    • A current month value.


[Examples]

>>> import apysc as ap
>>> _ = ap.Stage()
>>> datetime_: ap.DateTime = ap.DateTime(year=2022, month=12, day=1)
>>> datetime_.month
Int(12)

>>> datetime_.month = ap.Int(1)
>>> datetime_.month
Int(1)