Java Date to Time removeTime(Date date)

Here you can find the source of removeTime(Date date)

Description

remove Time

License

Open Source License

Declaration

public static Date removeTime(Date date) 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    final static SimpleDateFormat removeTimeDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public static Date removeTime(Date date) {
        try {/*from   w w w  .  ja  va2 s  .  c om*/
            return removeTimeDateFormat.parse(removeTimeDateFormat.format(date));
        } catch (ParseException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
}

Related

  1. getTimeString(java.util.Date date)
  2. getTimeText(Date date)
  3. getXSDDateTime()
  4. getXsdDateTime(Date time)
  5. getXsdDateTime(final Date d)
  6. serializeDateTime(final Date date)
  7. serializeXsdDateTime(Date date)
  8. strTime(Date dt)
  9. to24HrTimeString(Date date)