YearMonth.Now Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Now() | |
| Now(Clock) |
Obtains the current year-month from the specified clock. |
| Now(ZoneId) |
Obtains the current year-month from the system clock in the specified time-zone. |
Now()
[Android.Runtime.Register("now", "()Ljava/time/YearMonth;", "", ApiSince=26)]
public static Java.Time.YearMonth? Now();
[<Android.Runtime.Register("now", "()Ljava/time/YearMonth;", "", ApiSince=26)>]
static member Now : unit -> Java.Time.YearMonth
Returns
- Attributes
Applies to
Now(Clock)
Obtains the current year-month from the specified clock.
[Android.Runtime.Register("now", "(Ljava/time/Clock;)Ljava/time/YearMonth;", "", ApiSince=26)]
public static Java.Time.YearMonth? Now(Java.Time.Clock? clock);
[<Android.Runtime.Register("now", "(Ljava/time/Clock;)Ljava/time/YearMonth;", "", ApiSince=26)>]
static member Now : Java.Time.Clock -> Java.Time.YearMonth
Parameters
- clock
- Clock
the clock to use, not null
Returns
the current year-month, not null
- Attributes
Remarks
To be added.
Java reference for java.time.YearMonth.now.
Applies to
Now(ZoneId)
Obtains the current year-month from the system clock in the specified time-zone.
[Android.Runtime.Register("now", "(Ljava/time/ZoneId;)Ljava/time/YearMonth;", "", ApiSince=26)]
public static Java.Time.YearMonth? Now(Java.Time.ZoneId? zone);
[<Android.Runtime.Register("now", "(Ljava/time/ZoneId;)Ljava/time/YearMonth;", "", ApiSince=26)>]
static member Now : Java.Time.ZoneId -> Java.Time.YearMonth
Parameters
- zone
- ZoneId
the zone ID to use, not null
Returns
the current year-month using the system clock, not null
- Attributes
Remarks
Obtains the current year-month from the system clock in the specified time-zone. This will query the system clock to obtain the current year-month. Specifying the time-zone avoids dependence on the default time-zone. Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
Java reference for java.time.YearMonth.now.