Here you can find the source of toSQLTime(Instant timestamp)
Parameter | Description |
---|---|
timestamp | Instant |
public static java.sql.Timestamp toSQLTime(Instant timestamp)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ import java.time.Instant; public class Main { /** Convert EPICS time stamp into SQL time stamp * @param timestamp {@link Instant} * @return {@link java.sql.Timestamp} *//* ww w . ja v a 2 s. c om*/ public static java.sql.Timestamp toSQLTime(Instant timestamp) { final java.sql.Timestamp sql = new java.sql.Timestamp(timestamp.toEpochMilli()); sql.setNanos(timestamp.getNano()); return sql; } }