---
title: "setDisplayedMonth"
description: "Sets the [DatePickerState.displayedMonthMillis] based on a given [YearMonth].

Converts the [YearMonth] to the start of the first day of that month (midnight) in UTC and apply
it to the [DatePickerState] `displayedMonthMillis`."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
@RequiresApi(26)
fun DatePickerState.setDisplayedMonth(yearMonth: YearMonth)
```


Sets the `DatePickerState.displayedMonthMillis` based on a given `YearMonth`.

Converts the `YearMonth` to the start of the first day of that month (midnight) in UTC and apply
it to the `DatePickerState` `displayedMonthMillis`.

#### Parameters

| | |
| --- | --- |
| yearMonth | The `YearMonth` to display. |




<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
@RequiresApi(26)
fun DateRangePickerState.setDisplayedMonth(yearMonth: YearMonth)
```


Sets the `DateRangePickerState.displayedMonthMillis` based on a given `YearMonth`.

Converts the `YearMonth` to the start of the first day of that month (midnight) in UTC and apply
it to the `DateRangePickerState` `displayedMonthMillis`.

#### Parameters

| | |
| --- | --- |
| yearMonth | The `YearMonth` to display. |




