Java Date Time - MonthDay now(ZoneId zone) example








MonthDay now(ZoneId zone) creates the current month-day from the system clock in the specified time-zone.

Syntax

now has the following syntax.

public static MonthDay now(ZoneId zone)

Example

The following example shows how to use now.

import java.time.MonthDay;
import java.time.ZoneId;
//from   w  ww.ja  v a  2 s.  com
public class Main {
  public static void main(String[] args) {
    MonthDay m = MonthDay.now(ZoneId.systemDefault());

    System.out.println(m);

  }
}

The code above generates the following result.