Here you can find the source of getSeconds(Date dt)
Parameter | Description |
---|---|
dt | The given Date |
public static int getSeconds(Date dt)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { /**/*www . ja va 2 s .c om*/ * Returns Seconds of the date * * @param dt * The given Date * @return int */ public static int getSeconds(Date dt) { Calendar cal = Calendar.getInstance(); cal.setTime(dt); return cal.get(Calendar.SECOND); } }