//taking a timestamp apart using default timezone. GregorianCalendar cal = new GregorianCalendar(); cal.setTimeInMillis( timestamp ); int year = cal.get( Calendar.YEAR ); int month = cal.get( Calendar.MONTH ) + 1; int day = cal.get( Calendar.DAY_OF_MONTH ); int hour24 = cal.get( Calendar.HOUR_OF_DAY ); int hour12 = cal.get( Calendar.HOUR ); int amIs0OrPmIs1 = cal.get( Calendar.AM_PM ); int minute = cal.get( Calendar.MINUTE ); int second = cal.get( Calendar.SECOND );