From 37468beb9eb8507f07057521adbeabd7c21fa3b5 Mon Sep 17 00:00:00 2001 From: Jacques Foucry Date: Tue, 30 Aug 2016 17:58:37 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20m=C3=A9thode=20tomorrowAtNoon=20en=20mi?= =?UTF-8?q?lliseconde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/foucry/pilldroid/UtilDate.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/java/net/foucry/pilldroid/UtilDate.java b/app/src/main/java/net/foucry/pilldroid/UtilDate.java index fe90431..0d8e301 100644 --- a/app/src/main/java/net/foucry/pilldroid/UtilDate.java +++ b/app/src/main/java/net/foucry/pilldroid/UtilDate.java @@ -91,4 +91,21 @@ public class UtilDate { return (int) (todayDate.getTime() - oldDate.getTime()); } + + /** + * @param: none + * return int + */ + + public static long tomorrowAtNoon() { + Date now = new Date(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(now); + calendar.add(Calendar.DAY_OF_YEAR,1); + Date tomorrowAtNoon = dateAtNoon(calendar.getTime()); + + long millis = tomorrowAtNoon.getTime() - now.getTime(); + return millis; + } }