Java Instant Create instant(int _y, int _m, int _d, int _H, int _M, int _S)

Here you can find the source of instant(int _y, int _m, int _d, int _H, int _M, int _S)

Description

Get an Instant from local parameters: year, month, day, hour, minutes, seconds

License

Open Source License

Return

an Instant

Declaration

public static final Instant instant(int _y, int _m, int _d, int _H, int _M, int _S) 

Method Source Code

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

import java.time.Instant;

import java.time.LocalDateTime;

import java.time.ZoneOffset;

public class Main {
    public static final ZoneOffset localZoneOffset = ZoneOffset.UTC;

    /**/*  w w  w  . j a  v a  2  s  . co m*/
     * Get an Instant from local parameters: year, month, day, hour, minutes, seconds
     * 
     * @return an Instant
     */
    public static final Instant instant(int _y, int _m, int _d, int _H, int _M, int _S) {
        return LocalDateTime.of(_y, _m, _d, _H, _M, _S).toInstant(localZoneOffset);
    }
}

Related

  1. getEarliestInstant()
  2. getInstant(final Calendar calendar)
  3. getInstant(LocalDate localDate)
  4. getInstantOfEpoch(long seconds)
  5. getThisMonthBeginInstant()
  6. toInstant(BigDecimal value)