public static Date getPreviousDay ( Date dt ) { if ( dt == null ) { return dt ; } Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( dt ) ; cal . add ( Calendar . DAY_OF_YEAR , - 1 ) ; return cal . getTime ( ) ; }
added by zhuqian 2009 - 03 - 25