From 173d054219f1e37e7089c23cac0f530915834ee4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 14 Oct 2015 10:56:03 +1300 Subject: Add set current date method --- src/org/traccar/helper/DateBuilder.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/org/traccar/helper/DateBuilder.java b/src/org/traccar/helper/DateBuilder.java index 6e3fbc460..9a75d90fc 100644 --- a/src/org/traccar/helper/DateBuilder.java +++ b/src/org/traccar/helper/DateBuilder.java @@ -69,6 +69,11 @@ public class DateBuilder { return setDate(year, month, day); } + public DateBuilder setCurrentDate() { + Calendar now = Calendar.getInstance(calendar.getTimeZone()); + return setYear(now.get(Calendar.YEAR)).setMonth(now.get(Calendar.MONTH)).setDay(now.get(Calendar.DAY_OF_MONTH)); + } + public DateBuilder setHour(int hour) { calendar.set(Calendar.HOUR_OF_DAY, hour); return this; -- cgit v1.2.3