Java Timestamp Format format(Timestamp time)

Here you can find the source of format(Timestamp time)

Description

format

License

Open Source License

Declaration

public static Timestamp format(Timestamp time) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {

    public static Timestamp format(Timestamp time) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = sdf.format(time);
        date = date.substring(0, 10) + " 00:00:00";
        time = new Timestamp(sdf.parse(date).getTime());
        return time;
    }//from ww w .  j av  a2s .  c  o m
}

Related

  1. Format(DateFormat format, Timestamp time)
  2. format(final Date date)
  3. format(final long unixTimeStamp)
  4. format(long timestamp)
  5. format(long timeStamp)
  6. format2AdwordsTimestamp(Date date)
  7. format8chars(long timestamp)
  8. formataDataHoraMinuto(Timestamp dataHora)
  9. formatCalendar(Timestamp stamp)