ZonedDateTime.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(ZoneId) |
Obtains the current date-time from the system clock in the specified time-zone. |
| Now(Clock) |
Obtains the current date-time from the specified clock. |
| Now() |
Now(ZoneId)
Obtains the current date-time from the system clock in the specified time-zone.
[Android.Runtime.Register("now", "(Ljava/time/ZoneId;)Ljava/time/ZonedDateTime;", "", ApiSince=26)]
public static Java.Time.ZonedDateTime? Now(Java.Time.ZoneId? zone);
[<Android.Runtime.Register("now", "(Ljava/time/ZoneId;)Ljava/time/ZonedDateTime;", "", ApiSince=26)>]
static member Now : Java.Time.ZoneId -> Java.Time.ZonedDateTime
Parameters
- zone
- ZoneId
the zone ID to use, not null
Returns
the current date-time using the system clock, not null
- Attributes
Remarks
To be added.
Java reference for java.time.ZonedDateTime.now.
Applies to
Now(Clock)
Obtains the current date-time from the specified clock.
[Android.Runtime.Register("now", "(Ljava/time/Clock;)Ljava/time/ZonedDateTime;", "", ApiSince=26)]
public static Java.Time.ZonedDateTime? Now(Java.Time.Clock? clock);
[<Android.Runtime.Register("now", "(Ljava/time/Clock;)Ljava/time/ZonedDateTime;", "", ApiSince=26)>]
static member Now : Java.Time.Clock -> Java.Time.ZonedDateTime
Parameters
- clock
- Clock
the clock to use, not null
Returns
the current date-time, not null
- Attributes
Remarks
Obtains the current date-time from the specified clock. This will query the specified clock to obtain the current date-time. The zone and offset will be set based on the time-zone in the clock. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using dependency injection.
Java reference for java.time.ZonedDateTime.now.
Applies to
Now()
[Android.Runtime.Register("now", "()Ljava/time/ZonedDateTime;", "", ApiSince=26)]
public static Java.Time.ZonedDateTime? Now();
[<Android.Runtime.Register("now", "()Ljava/time/ZonedDateTime;", "", ApiSince=26)>]
static member Now : unit -> Java.Time.ZonedDateTime
Returns
- Attributes