Skip to content

Instantly share code, notes, and snippets.

@soolaugust
Created May 29, 2020 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soolaugust/c9880a1730d41f168695ef3d8fc1efcb to your computer and use it in GitHub Desktop.
Save soolaugust/c9880a1730d41f168695ef3d8fc1efcb to your computer and use it in GitHub Desktop.
get current timestamp with timezone, 获取当前时区的时间戳。
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