public static long getTimeSinceMidnight ( ) { Calendar c = Calendar . getInstance ( ) ; long now = c . getTimeInMillis ( ) ; c . set ( Calendar . HOUR_OF_DAY , 0 ) ; c . set ( Calendar . MINUTE , 0 ) ; c . set ( Calendar . SECOND , 0 ) ; c . set ( Calendar . MILLISECOND , 0 ) ; return now - c . getTimeInMillis ( ) ; }
Miliseconds since midnight