Java Date Format As formatDay(java.util.Date d)

Here you can find the source of formatDay(java.util.Date d)

Description

format Day

License

Open Source License

Declaration

public static String formatDay(java.util.Date d) 

Method Source Code

//package com.java2s;
/*//from   w ww.j  a v a  2  s . c  o m
 * Copyright 2010 Mttang.com All right reserved. This software is the
 * confidential and proprietary information of Mttang.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Mttang.com.
 */

import java.text.SimpleDateFormat;

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

    public static String formatDay(java.util.Date d) {
        return yyyyMMdd.format(d);
    }

    public static String formatDay(java.util.Calendar d) {
        return yyyyMMdd.format(d.getTime());
    }
}

Related

  1. formatDateWithMilliseconds(DateFormat aFormat, Date aDate)
  2. formatDateYMD(Object date)
  3. formatDateYyyymmddhhmmss(Date date)
  4. formatDatum(Date date, Locale locale)
  5. formatDay(Date date)
  6. formatDDMMYYYY(Date date)
  7. formatddMMyyyy(Date date)
  8. getDateAsISO8601String(Date date)
  9. getDateAsISO8601String(Date date)