Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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