Back to project page playnomics-android.
The source code is released under:
Apache License
If you think the Android project playnomics-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.playnomics.android.util; /* ww w.j a va 2 s. c o m*/ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.TimeZone; public class EventTime extends GregorianCalendar implements Comparable<Calendar> { private static final long serialVersionUID = 1L; public EventTime() { super(Util.TIME_ZONE_GMT); } public EventTime(long millisecondsSinceEpoch) { this(); ((Calendar) this).setTimeInMillis(millisecondsSinceEpoch); } public static int getMinutesTimezoneOffset() { // get the offset local timezone from GMT in ms (local time + offset = // UTC time) int millisecondsOffset = TimeZone.getDefault().getRawOffset(); int minutesOffset = millisecondsOffset / (60 * 1000); // flip the sign, because we want to view the calculation as UTC - // offset = localTime return minutesOffset * -1; } @Override public String toString() { return String.format("%d", getTimeInMillis()); } }