Example usage for java.time OffsetDateTime getLong

List of usage examples for java.time OffsetDateTime getLong

Introduction

In this page you can find the example usage for java.time OffsetDateTime getLong.

Prototype

@Override
public long getLong(TemporalField field) 

Source Link

Document

Gets the value of the specified field from this date-time as a long .

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    long l = o.getLong(ChronoField.DAY_OF_WEEK);
    System.out.println(l);/*from w  w w  . j a  v  a 2  s.  c o m*/
}