Java Date to Minute getMinutesInDay(Date d)

Here you can find the source of getMinutesInDay(Date d)

Description

get Minutes In Day

License

Open Source License

Declaration

public static int getMinutesInDay(Date d) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2013 Dominik Halfkann, Michael Backhaus, Benjamin Kramer,
 * Fabian K?nig, Karl Stelzner, Stefan Noll and Alexander Schieweck.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html//from   w w w.  j  av  a 2s. co m
 ******************************************************************************/

import java.util.Calendar;
import java.util.Date;

public class Main {
    private static Calendar c1 = Calendar.getInstance();

    public static int getMinutesInDay(Date d) {
        c1.setTime(d);
        return c1.get(Calendar.HOUR_OF_DAY) * 60 + c1.get(Calendar.MINUTE);
    }
}

Related

  1. getMinute(java.util.Date date)
  2. getMinuteOfHour(final Date date)
  3. getMinutes(Date d)
  4. getMinutes(Date time)
  5. getMinutes(final Date date)
  6. getMinutesOfHour(Date dt)
  7. minute(Date date)
  8. minute(final Date date)
  9. minuteAdd(Date date, int val)