equal
deleted
inserted
replaced
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); |