Here you can find the source of getTimeOfDaySeconds()
public static float getTimeOfDaySeconds()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static Calendar cal = Calendar.getInstance(); private static SimpleDateFormat hour = new SimpleDateFormat("HH"), minute = new SimpleDateFormat("mm"), second = new SimpleDateFormat("ss"); /**/*w ww .j a v a2 s .c o m*/ * Calculates current time as a float * * @return Time of Day in Seconds */ public static float getTimeOfDaySeconds() { return (((Float.parseFloat(hour.format(cal.getTime())) * 3600) + (Float.parseFloat(minute.format(cal.getTime())) * 60) + Float.parseFloat(second.format(cal.getTime()))) * 1000); } }