Java Instant Create deserializeToInstant(String date)

Here you can find the source of deserializeToInstant(String date)

Description

deserialize To Instant

License

Apache License

Declaration

public static Instant deserializeToInstant(String date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

public class Main {
    private static final DateTimeFormatter ISO_FORMAT = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
    public static final ZoneId UTC = ZoneId.of("UTC");

    public static Instant deserializeToInstant(String date) {
        return deserialize(date).toInstant(ZoneOffset.UTC);
    }/*from w  w w .  ja va 2  s  . com*/

    public static LocalDateTime deserialize(String date) {
        return LocalDateTime.parse(date, ISO_FORMAT);
    }
}

Related

  1. convertDotNetTicksToInstant(long dotNetTicks)
  2. deserializeToInstant(String date)
  3. end(String msg, long amount, Instant start)
  4. getEarliestInstant()
  5. getInstant(final Calendar calendar)
  6. getInstant(LocalDate localDate)