Created
May 29, 2020 06:22
-
-
Save soolaugust/c9880a1730d41f168695ef3d8fc1efcb to your computer and use it in GitHub Desktop.
get current timestamp with timezone, 获取当前时区的时间戳。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimeUtils { | |
public static long getCurrentTimeWithTimeZone(){ | |
java.util.Calendar cal = java.util.Calendar.getInstance(); | |
return cal.getTimeInMillis() + cal.getTimeZone().getRawOffset(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment