Example usage for java.util Date getMinutes

List of usage examples for java.util Date getMinutes

Introduction

In this page you can find the example usage for java.util Date getMinutes.

Prototype

@Deprecated
public int getMinutes() 

Source Link

Document

Returns the number of minutes past the hour represented by this date, as interpreted in the local time zone.

Usage

From source file:Main.java

public static int getMinute() {
    Calendar cal = Calendar.getInstance();
    Date date = cal.getTime();
    return date.getMinutes();
}

From source file:Main.java

public static final int getMinByMill(long mill) {
    Date curDate = new Date(mill);
    return curDate.getMinutes();
}

From source file:Main.java

public static final int getPhoneMin() {
    Date curDate = new Date(System.currentTimeMillis());
    return curDate.getMinutes();
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static int minutesFromDate(Date date) {
    return date.getHours() * 60 + date.getMinutes();
}

From source file:Main.java

public static int dateToTimeValue(Date date) {
    return dateToTimeValue(date.getHours(), date.getMinutes());
}

From source file:Main.java

public static String getCurrentTimeString() {
    Date timeDate = new Date(System.currentTimeMillis());
    String min = "" + timeDate.getMinutes();
    if (min.length() < 2) {
        min = "0" + min;
    }//from w  w  w .j  ava 2s  .com
    String h = "" + timeDate.getHours();
    if (h.length() < 2) {
        h = "0" + h;
    }
    return h + ":" + min;
}

From source file:Main.java

/**
 * @param date/*from w ww.  j  ava2s  . co  m*/
 *
 * @return
 */
public static String getFormatedDate(Date date) {
    return date.getYear() + "-" + date.getMonth() + "-" + date.getDay() + " - At " + date.getHours() + ":"
            + date.getMinutes();
}

From source file:Main.java

public static Date getTaskDueDateFromIso8601String(String s) {
    System.err.println("Importing date string: " + s);
    Date date = getDateFromIso8601String(s);
    System.err.println("Got date: " + date);
    if (date != null) {
        if (date.getHours() == 23 && date.getMinutes() == 59 && date.getSeconds() == 59) {
            date.setHours(12);//from  w  w  w.  j  av  a 2 s.  co  m
            date.setMinutes(0);
            date.setSeconds(0);
        }
    }
    return date;
}

From source file:Main.java

public static String date2str(Date date) {
    if (date == null)
        return null;

    return date2str(date.getYear() + 1900, date.getMonth() + 1, date.getDate(), date.getHours(),
            date.getMinutes());
}

From source file:Main.java

public static String timeToReadableString(Date date) {
    String returned = "";
    if (date.getHours() < 10)
        returned += "0" + date.getHours();
    else/* www  . j a  va2  s  .  c  om*/
        returned += date.getHours();
    returned += ":";
    if (date.getMinutes() < 10)
        returned += "0" + date.getMinutes();
    else
        returned += date.getMinutes();
    return returned;
}