DayOfWeek
CaupolicanDiaz142 total contributions
Published Nov 14, 2023Updated Nov 17, 2023
Contribute to Docs
The DayOfWeek
method is used to return the DayOfWeek
instance for the weekday number, starting with 1
as Monday
.
Syntax
DayOfWeek(isoDayNumber)
isoDayNumber
: An integer value that must correspond to one of the seven days in theDayOfWeek
enumeration class. The numbering follows the ISO-8601 weekday number, whereMonday
is1
andSunday
is7
.- The enumeration class entries have two properties:
Name
, which is represented by astring
, and theOrdinal
, which is represented as an integer.
Example
Here is an example of how to call the DayOfWeek
method:
import kotlinx.datetime.*fun main() {val day = DayOfWeek.of(3)println(day)}
The output will be:
Wednesday
All contributors
- CaupolicanDiaz142 total contributions
- Anonymous contributorAnonymous contributor1 total contribution
- CaupolicanDiaz
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.