Skip to content

🧪 Datetime

A date and time.

Parameters:

Name Type Description Default
year Int The year. -
month Int The month. Must be between 1 and 12. -
day Int The day. Must be between 1 and 31. -
hour Int The hour. Must be between 0 and 23. -
minute Int The minute. Must be between 0 and 59. -
second Int The second. Must be between 0 and 59. -
microsecond Int The microsecond. Must be between 0 and 999,999. 0
Stub code in Datetime.sdsstub

@Experimental
@PythonName("datetime")
class Datetime(
    year: Int,
    const month: Int,
    const day: Int,
    const hour: Int,
    const minute: Int,
    const second: Int,
    const microsecond: Int = 0
) where {
    month >= 1,
    month <= 12,
    day >= 1,
    day <= 31,
    hour >= 0,
    hour <= 23,
    minute >= 0,
    minute <= 59,
    second >= 0,
    second <= 59,
    microsecond >= 0,
    microsecond <= 999999
} {
    /**
     * The year.
     */
    attr year: Int

    /**
     * The month.
     */
    attr month: Int

    /**
     * The day.
     */
    attr day: Int

    /**
     * The hour.
     */
    attr hour: Int

    /**
     * The minute.
     */
    attr minute: Int

    /**
     * The second.
     */
    attr second: Int

    /**
     * The microsecond.
     */
    attr microsecond: Int
}

day

The day.

Type: Int

hour

The hour.

Type: Int

microsecond

The microsecond.

Type: Int

minute

The minute.

Type: Int

month

The month.

Type: Int

second

The second.

Type: Int

year

The year.

Type: Int