Java LocalDateTime to getMinuteOfDay(LocalDateTime ldt)

Here you can find the source of getMinuteOfDay(LocalDateTime ldt)

Description

Get the minute of the day for a given java.time.LocalDateTime .

License

Open Source License

Parameter

Parameter Description
ldt java.time.LocalDateTime source

Return

minute-of-day for given

Declaration

public static int getMinuteOfDay(LocalDateTime ldt) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDateTime;

public class Main {
    /**/*ww  w  .  j a v a2 s.c  o  m*/
     * Get the minute of the day for a given {@link java.time.LocalDateTime}.  For example,
     * 1:05 AM = 60+5 = 65, 2:10 AM = 120 + 10 = 130, etc.  Provides an easy way to sort
     * {@link java.time.LocalDateTime} objects based on time-of-day, but independent of which
     * day they occur.
     * 
     * @param ldt {@link java.time.LocalDateTime} source
     * @return minute-of-day for given {@link java.time.LocalDateTime}
     */
    public static int getMinuteOfDay(LocalDateTime ldt) {
        return ((ldt.getHour() * 60) + ldt.getMinute());
    }
}

Related

  1. getDifference(LocalDateTime sourceTime, LocalDateTime targetTime)
  2. getDurationInMillis(LocalDateTime from, LocalDateTime to)
  3. getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit)
  4. getHoursElapsed(LocalDateTime fromDate)
  5. getMillis(LocalDateTime time)
  6. getSecondsSinceJavaEpoch(LocalDateTime localDateTime)
  7. localDateTimeToDate(LocalDateTime ldt)
  8. localDateTimeToEpochMillis(TemporalAccessor temporal)
  9. localDateTimeToString(LocalDateTime value)