jdk/src/java.sql/share/classes/java/sql/Timestamp.java
changeset 25991 e48157b42439
parent 25976 4de01a56e3ee
parent 25859 3317bb8137f4
child 26596 85ea379d419a
equal deleted inserted replaced
25876:d06a6d3c66c0 25991:e48157b42439
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   588      * @param instant  the instant to convert
   588      * @param instant  the instant to convert
   589      * @return an {@code Timestamp} representing the same point on the time-line as
   589      * @return an {@code Timestamp} representing the same point on the time-line as
   590      *  the provided instant
   590      *  the provided instant
   591      * @exception NullPointerException if {@code instant} is null.
   591      * @exception NullPointerException if {@code instant} is null.
   592      * @exception IllegalArgumentException if the instant is too large to
   592      * @exception IllegalArgumentException if the instant is too large to
   593      *  represent as a {@code Timesamp}
   593      *  represent as a {@code Timestamp}
   594      * @since 1.8
   594      * @since 1.8
   595      */
   595      */
   596     public static Timestamp from(Instant instant) {
   596     public static Timestamp from(Instant instant) {
   597         try {
   597         try {
   598             Timestamp stamp = new Timestamp(instant.getEpochSecond() * MILLIS_PER_SECOND);
   598             Timestamp stamp = new Timestamp(instant.getEpochSecond() * MILLIS_PER_SECOND);