Here you can find the source of getMinutes(Date time)
Parameter | Description |
---|---|
time | the time |
public static int getMinutes(Date time)
//package com.java2s; /*/*from w ww . j a va 2s .c om*/ * Version: 1.0 * * The contents of this file are subject to the OpenVPMS License Version * 1.0 (the 'License'); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.openvpms.org/license/ * * Software distributed under the License is distributed on an 'AS IS' basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Copyright 2015 (C) OpenVPMS Ltd. All Rights Reserved. */ import java.util.Calendar; import java.util.Date; public class Main { /** * Returns the minutes from midnight for the specified time. * * @param time the time * @return the minutes from midnight for {@code time} */ public static int getMinutes(Date time) { Calendar calendar = Calendar.getInstance(); calendar.setTime(time); int hour = calendar.get(Calendar.HOUR_OF_DAY); int mins = calendar.get(Calendar.MINUTE); return (hour * 60) + mins; } }