import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class TimeUtil {
public static final int SECONDS_IN_DAY = 60 * 60 * 24;
public static final long MILLIS_IN_DAY = 1000L * SECONDS_IN_DAY;
public static boolean isSameDayOfMillis( String str1, String str2) {
final long ms1=Long.parseLong(str1);//字符串转换成长整型
final long ms2=Long.parseLong(str2);//字符串转换成长整型
final long interval = ms1 - ms2;
return interval < MILLIS_IN_DAY
&& interval > -1L * MILLIS_IN_DAY
&& toDay(ms1) == toDay(ms2);
}
private static long toDay(long millis) {
return (millis + TimeZone.getDefault().getOffset(millis)) / MILLIS_IN_DAY;
}
public static void main(String[] args) throws ParseException {
//
SimpleDateFormat date=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒 ");
//
String str1="1476973800000";
String str2="1477063800000";
System.out.println(toDay(1477063800000L));
//
SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd");
// Date date=simpleDateFormat .parse("2010-06-25");
// long timeStemp = date.getTime();
// String s=Long.toString(timeStemp);//长整型转换成字符串
// long m=Long.parseLong(s);
}
}