Skip to content

Instantly share code, notes, and snippets.

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 inferjay/7233861 to your computer and use it in GitHub Desktop.
Save inferjay/7233861 to your computer and use it in GitHub Desktop.
获取北京时区当天开始时间的毫秒值
public static long getTodayStartTime(){
Calendar todayStart = Calendar.getInstance(new SimpleTimeZone(0, "Asia/Beijing"));
todayStart.set(Calendar.HOUR, 0);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(Calendar.MILLISECOND, 0);
Date today = (Date) todayStart.getTime().clone();
return today.getTime();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment