Android Date to String Convert getShortDateTimeString(Date date)

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

Description

get Short Date Time String

License

Apache License

Declaration

public static final String getShortDateTimeString(Date date) 

Method Source Code

//package com.java2s;
/*/*from   w w w.j  a va  2 s  .  c  o m*/
 * Copyright 2014 http://Bither.net
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String SHORT_DATE_TIME_FORMAT = "MM-dd HH:mm";

    public static final String getShortDateTimeString(Date date) {
        SimpleDateFormat df = new SimpleDateFormat(SHORT_DATE_TIME_FORMAT);
        return df.format(date);

    }
}

Related

  1. getFileName()
  2. getFormatString(Date date, String dateFormat)
  3. getHourInFloat(Date date)
  4. getLongDateStr(Date date)
  5. getLongFormat(Date date)
  6. getShortFormat(Date date)
  7. getStringFromDate(Date date)
  8. javaDateToIso8601(Date date)
  9. javaDateToTimeSpan(final Date date)