Here you can find the source of isToday(LocalDateTime dateTime)
Parameter | Description |
---|---|
dateTime | a datetime |
public static boolean isToday(LocalDateTime dateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.LocalDateTime; public class Main { /**//from w w w .j a va 2s.co m * Check if datetime is from today * * @param dateTime a datetime * @return true / false */ public static boolean isToday(LocalDateTime dateTime) { LocalDate today = LocalDate.now(); LocalDate date = dateTime.toLocalDate(); return date.equals(today); } }