package com.laxture.skeleton.util;

import org.joda.time.DateMidnight;
import org.joda.time.DateTime;

public class ServerTime {

    private static long sLocalTimeOffset;

    public static long currentTimeMillis() {
        return System.currentTimeMillis() + sLocalTimeOffset;
    }

    public static long currentTime() {
        return (System.currentTimeMillis() + sLocalTimeOffset)/1000;
    }

    public static void setServerTime(long serverTime) {
        if (serverTime <= 0) return;
        sLocalTimeOffset = serverTime*1000 - System.currentTimeMillis();
    }

    public static DateTime currentDateTime() {
        return new DateTime(currentTimeMillis());
    }

    public static DateMidnight currentDateMidnight() {
        return new DateMidnight(currentTimeMillis());
    }

}

@@ -284,123 +284,8 @@
  %7D%0A%0A
-    public static long currentTime() %7B%0A        return (System.currentTimeMillis() + sLocalTimeOffset)/1000;%0A    %7D%0A%0A
     
@@ -414,13 +414,8 @@
 Time
-*1000
  - S
@@ -556,122 +556,6 @@
  %7D%0A%0A
-    public static DateMidnight currentDateMidnight() %7B%0A        return new DateMidnight(currentTimeMillis());%0A    %7D%0A%0A
 %7D%0A

Fix ServerTime