Close

Java Date Time - ZonedDateTime.getDayOfWeek() Examples

Java Date Time Java Java API 


Class:

java.time.ZonedDateTime

java.lang.Objectjava.lang.Objectjava.time.ZonedDateTimejava.time.ZonedDateTimejava.time.temporal.TemporalTemporaljava.time.chrono.ChronoZonedDateTimeChronoZonedDateTimejava.io.SerializableSerializableLogicBig

Method:

public DayOfWeek getDayOfWeek()

This method returns the day of week field value of this ZonedDateTime instance.


Examples


package com.logicbig.example.zoneddatetime;

import java.time.DayOfWeek;
import java.time.ZonedDateTime;

public class GetDayOfWeekExample {

public static void main(String... args) {
ZonedDateTime d = ZonedDateTime.now();
DayOfWeek dayOfWeek = d.getDayOfWeek();
System.out.println(dayOfWeek);
}
}

Output

MONDAY




See Also