Java Instant Format format(Instant instant)

Here you can find the source of format(Instant instant)

Description

format

License

Open Source License

Declaration

public static String format(Instant instant) 

Method Source Code


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

import java.time.Instant;

import java.time.ZoneId;

import java.time.format.DateTimeFormatter;

public class Main {
    private static DateTimeFormatter outputDateFormat = DateTimeFormatter.ofPattern("uuuu-MM-dd")
            .withZone(ZoneId.of("UTC"));

    public static String format(Instant instant) {
        return outputDateFormat.format(instant);
    }/* w  ww  .  j  a v a  2  s  . c om*/
}

Related

  1. format(Instant _instant, String _format)
  2. formatAtSAST(Instant instant, DateTimeFormatter format)
  3. formatDate(Instant date, Locale locale)
  4. formatDateForInstant(Instant instant)
  5. formatHttpDate(Instant instant)