Java Calendar to String calendarOutput(Calendar date)

Here you can find the source of calendarOutput(Calendar date)

Description

Generiert eine Zeichenkette-Ausgabe im Format "dd.MM.yyyy"

License

Open Source License

Parameter

Parameter Description
date Datum, welches aus gegeben werden soll

Return

einen Formatierte Datumsausgabe in Form von "dd.MM.yyyy"

Declaration

public static String calendarOutput(Calendar date) 

Method Source Code


//package com.java2s;
/*/*from  ww w .  jav a 2  s.c o m*/
 * 
 * Copyright (c) 2011 by Jgility Development Group
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Karsten Schulz
 *
 */

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    /**
     * Generiert eine Zeichenkette-Ausgabe im Format "dd.MM.yyyy"
     * 
     * @param date Datum, welches aus gegeben werden soll
     * @return einen Formatierte Datumsausgabe in Form von "dd.MM.yyyy"
     */
    public static String calendarOutput(Calendar date) {
        SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
        return sdf.format(date.getTime());
    }
}

Related

  1. calendar2string(Calendar calendar, String formatString)
  2. calendarDateToStrFormatddMMMyy(final Calendar cal)
  3. calendarParaString(Calendar cal)
  4. calendarToIso(Calendar c)
  5. calendarToSiteDataString(final Calendar cal)
  6. calendarToStorageRoomTimeString(Calendar cal)