Java Date to String date2StringISO(Date date)

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

Description

Erzeugt einen String im Format YYYY-MM-DD

License

Open Source License

Declaration

public static String date2StringISO(Date date) 

Method Source Code

//package com.java2s;
/*  $Id: HBCIUtils.java,v 1.2 2011/11/24 21:59:37 willuhn Exp $
    //from  w  w w . j  ava  2  s .  co m
This file is part of HBCI4Java
Copyright (C) 2001-2008  Stefan Palme
    
HBCI4Java is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
    
HBCI4Java is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

import java.text.*;
import java.util.*;

public class Main {
    /**
     * Erzeugt einen String im Format YYYY-MM-DD
     */
    public static String date2StringISO(Date date) {
        return new SimpleDateFormat("yyyy-MM-dd").format(date);
    }
}

Related

  1. date2String(java.util.Date date, String format)
  2. date2String(java.util.Date date, String pattern)
  3. date2String(String formater, Date aDate)
  4. date2String(String pattern, Date date)
  5. date2String2(Date date)
  6. date2StringMD(Date date)
  7. date2StringPattern(Date value, String pattern)
  8. Date2StringSec(Date date)
  9. datetime(Date date)