From 1eabc780b807daade9220e004a301a1c5969ef66 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:33:26 +0100 Subject: - bug fix for time zones --- .../uic/barcode/ticket/api/utils/DateTimeUtils.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/org/uic/barcode/ticket/api/utils') diff --git a/src/org/uic/barcode/ticket/api/utils/DateTimeUtils.java b/src/org/uic/barcode/ticket/api/utils/DateTimeUtils.java index a0283c7..c8664a5 100644 --- a/src/org/uic/barcode/ticket/api/utils/DateTimeUtils.java +++ b/src/org/uic/barcode/ticket/api/utils/DateTimeUtils.java @@ -110,10 +110,7 @@ public class DateTimeUtils { } int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE); - if (time > 0) { - return new Long (time ); - } - return null; + return new Long (time ); } public static Long getTime (Date date) { @@ -121,18 +118,9 @@ public class DateTimeUtils { Calendar cal = Calendar.getInstance(); cal.clear(); cal.setTime(date); - - if (cal == null || - !cal.isSet(Calendar.HOUR_OF_DAY) || - !cal.isSet(Calendar.MINUTE) ) { - return null; - } - + int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE); - if (time > 0) { - return new Long (time ); - } - return null; + return new Long (time ); } public static Date getDate(Date issuingDate, Long date, Long time){ -- cgit v1.2.3