Here you can find the source of dateArrayFromSeconds(int inSeconds)
public static int[] dateArrayFromSeconds(int inSeconds)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w. j av a 2s. c o m*/ * Given a number of seconds, creates an int[] detailing the * months, days, and hours difference as well. * <p/> * 0: days<br> * 1: hours<br> * 2:minutes<br> * 3:seconds<br> * * @return int array */ public static int[] dateArrayFromSeconds(int inSeconds) { int days = (int) (inSeconds / (60 * 60 * 24)); inSeconds -= (days * 60 * 60 * 24); int hours = (int) (inSeconds / (60 * 60)); inSeconds -= (hours * 60 * 60); int minutes = (int) (inSeconds / 60); inSeconds -= (minutes * 60); return new int[] { days, hours, minutes, inSeconds }; } }