Java Date Time to String dateTimeToString(Date d)

Here you can find the source of dateTimeToString(Date d)

Description

date Time To String

License

Open Source License

Declaration

public static String dateTimeToString(Date d) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2013 Dominik Halfkann, Michael Backhaus, Benjamin Kramer,
 * Fabian K?nig, Karl Stelzner, Stefan Noll and Alexander Schieweck.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html/*  ww w .  j a v a 2s. c om*/
 ******************************************************************************/

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

public class Main {
    private static Calendar c1 = Calendar.getInstance();

    public static String dateTimeToString(Date d) {
        c1.setTime(d);
        Date date = c1.getTime();
        String strDate = "";
        SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm");
        strDate = sdf.format(date);
        return strDate;
    }
}

Related

  1. dateTimeToString(Calendar dateTime)
  2. dateTimeToString(Date d)
  3. dateTimeToString(Date date)
  4. DateTimeToString(Date date)
  5. dateTimeToString(Date date)
  6. dateTimeToString(Date date)