Java ZonedDateTime Format getFormattedHour(ZonedDateTime dateTime)

Here you can find the source of getFormattedHour(ZonedDateTime dateTime)

Description

get Formatted Hour

License

Open Source License

Declaration

public static String getFormattedHour(ZonedDateTime dateTime) 

Method Source Code

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

import java.time.ZonedDateTime;

public class Main {
    public static String getFormattedHour(ZonedDateTime dateTime) {
        if (dateTime.getHour() < 10) {
            return "0" + dateTime.getHour();
        }// w  w w.  j a  va  2 s  . c o m

        return String.valueOf(dateTime.getHour());
    }
}

Related

  1. formatDate_ddMMYYYYHHmmss(ZonedDateTime now)
  2. formatDateAsShortDateLocalTime(ZonedDateTime moonDate, ZoneId tz)
  3. formatDateForGMT(ZonedDateTime moonDate)
  4. formatDateTime(ZonedDateTime zonedDateTime)
  5. formatZonedDateTime(ZonedDateTime zonedDateTime)
  6. parseZonedDateTime(String s, DateTimeFormatter dtf)
  7. toStringExcelFormat(ZonedDateTime date)
  8. toZonedDateTime(String date, DateTimeFormatter formatter)