Here you can find the source of secondsBetween(LocalDateTime date1, LocalDateTime date2)
Parameter | Description |
---|---|
date1 | The first date |
date2 | The second date |
public static long secondsBetween(LocalDateTime date1, LocalDateTime date2)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; public class Main { /**/*from w w w.j a va 2 s .co m*/ * Calculate the time between two dates, in seconds * @param date1 The first date * @param date2 The second date * @return The number of seconds between the dates */ public static long secondsBetween(LocalDateTime date1, LocalDateTime date2) { return ChronoUnit.SECONDS.between(date1, date2); } }