Here you can find the source of getSignContinusDay(Date lastSignTime)
public static int getSignContinusDay(Date lastSignTime)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static int getSignContinusDay(Date lastSignTime) { Date date = new Date(); SimpleDateFormat datetr = new SimpleDateFormat("yyyyMMdd"); String lastSign = datetr.format(lastSignTime); String nowDay = datetr.format(date); int lastSignDay = Integer.parseInt(lastSign); int newDay = Integer.parseInt(nowDay); return newDay - lastSignDay; }/*from w w w. j av a 2s . c o m*/ public static String format(Date date, String pattern) { if (date == null) { return null; } SimpleDateFormat sf = new SimpleDateFormat(pattern); return sf.format(date); } public static String format(Date date) { return format(date, "yyyy-MM-dd"); } }