Here you can find the source of fromInfluxDBTimeFormat(final String timestamp)
public static Instant fromInfluxDBTimeFormat(final String timestamp)
//package com.java2s; //License from project: Open Source License import java.time.Instant; import java.time.format.DateTimeFormatter; public class Main { public static Instant fromInfluxDBTimeFormat(final String timestamp) { return Instant.from(DateTimeFormatter.ISO_INSTANT.parse(timestamp)); }//from ww w. j a va 2s . co m public static Instant fromInfluxDBTimeFormat(final Object timestamp) throws Exception { if (timestamp == null) throw new Exception("Cannot convert null to instant timestamp"); if (timestamp instanceof String) return fromInfluxDBTimeFormat((String) timestamp); if (timestamp instanceof Double) { Double millis = (Double) timestamp / 1000000.0; Double nanos = (Double) timestamp - (millis * 1000000.0); return Instant.ofEpochMilli(millis.longValue()).plusNanos(nanos.longValue()); } throw new Exception("Cannot convert nonstring object to instant : " + timestamp.getClass().getName()); } }