aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/DateBuilder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-14 10:56:03 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-14 10:56:03 +1300
commit173d054219f1e37e7089c23cac0f530915834ee4 (patch)
tree87964b888f6853b10ffc304e12c4720e5a556302 /src/org/traccar/helper/DateBuilder.java
parente494177a4f0c48ef38f0293ff14b07d170842116 (diff)
downloadtrackermap-server-173d054219f1e37e7089c23cac0f530915834ee4.tar.gz
trackermap-server-173d054219f1e37e7089c23cac0f530915834ee4.tar.bz2
trackermap-server-173d054219f1e37e7089c23cac0f530915834ee4.zip
Add set current date method
Diffstat (limited to 'src/org/traccar/helper/DateBuilder.java')
-rw-r--r--src/org/traccar/helper/DateBuilder.java5
1 files changed, 5 insertions, 0 deletions
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;