Here you can find the source of getCurrentToNextDaySecond()
public static Integer getCurrentToNextDaySecond()
//package com.java2s; /**// w ww .ja v a 2 s. c o m * Copyright (c)2010-2011 Enterprise Website Content Management System(EWCMS), All rights reserved. * EWCMS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * http://www.ewcms.com */ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static Integer getCurrentToNextDaySecond() { try { Date current = new Date(Calendar.getInstance().getTime().getTime()); Calendar calendar = Calendar.getInstance(); current.setTime(current.getTime()); calendar.add(Calendar.DATE, 1); SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd"); Date nextDay = simple.parse(simple.format(calendar.getTime())); Long interval = (nextDay.getTime() - current.getTime() - 1) / 1000; return interval.intValue(); } catch (Exception e) { return -1; } } }