Here you can find the source of diffMs(ZonedDateTime date1, ZonedDateTime date2)
Parameter | Description |
---|---|
date1 | a parameter |
date2 | a parameter |
public static long diffMs(ZonedDateTime date1, ZonedDateTime date2)
//package com.java2s; //License from project: Open Source License import java.time.Duration; import java.time.ZonedDateTime; public class Main { /**//from ww w . ja va 2 s. c om * Finds the difference (in ms) between two LocalDateTime. Returns date2 - date1. * * @param date1 * @param date2 * @return time difference in ms */ public static long diffMs(ZonedDateTime date1, ZonedDateTime date2) { return Duration.between(date1, date2).getSeconds() * 1000; } }