001package edu.pdx.cs410J.datesAndText; 002 003import java.time.LocalDateTime; 004import java.time.temporal.ChronoField; 005 006public class LocalDateTimeExample { 007 008 public static void main(String[] args) { 009 LocalDateTime now = LocalDateTime.now(); 010 System.out.println("Now: " + now); 011 012 int dayOfYear = now.get(ChronoField.DAY_OF_YEAR); 013 System.out.println("Day of Year: " + dayOfYear); 014 015 LocalDateTime yesterday = now.minusDays(1); 016 System.out.println("Yesterday: " + yesterday); 017 018 LocalDateTime newYears = LocalDateTime.of(2024, 1, 1, 0, 0, 0); 019 System.out.println("New Years: " + newYears); 020 } 021}