Java Timestamp roundToSecond(Timestamp t)

Here you can find the source of roundToSecond(Timestamp t)

Description

round To Second

License

Apache License

Declaration

public static Timestamp roundToSecond(Timestamp t) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.sql.Timestamp;

public class Main {
    public static Timestamp roundToSecond(Timestamp t) {
        return new Timestamp((t.getTime() / 1000) * 1000);
    }/*from w w  w.j av a 2s  .c om*/
}

Related

  1. readTimestamp(DataInput in)
  2. readTimestamp(ObjectInput in, long nullFlag)
  3. removeTime(Timestamp ts)
  4. resetHourMinuteSecond(Timestamp timestamp, int hour, int minute, int second)
  5. roundToHour(Timestamp arg)
  6. safeTimestamp(Date value)
  7. setTimestamp(byte[] ba, int offset, Timestamp val)
  8. setTimestamp(int index, Timestamp t, PreparedStatement stmt)
  9. setTimestampOrNull(PreparedStatement pstmt, int paramIndex, Timestamp value)