Java Timestamp Format getTimeStampFormat(Date date)

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

Description

get Time Stamp Format

License

Open Source License

Declaration

public static String getTimeStampFormat(Date date) 

Method Source Code

//package com.java2s;
/**//from  w  w  w. j a v a  2 s.com
 * Copyright(C) 2010-2014 Samsung Electronics Co., Ltd. All rights reserved.
 *
 *   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 SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    public static final SimpleDateFormat mElapsedTimeFormat = new SimpleDateFormat("HH:mm:ss");

    public static String getTimeStampFormat(Date date) {
        return mDateFormat.format(date) + " " + mElapsedTimeFormat.format(date);
    }
}

Related

  1. getFullTimestampFormatter(Locale locale)
  2. getTimestamp(boolean useTwentyFourFormat)
  3. getTimeStamp(String format)
  4. getTimestamp(String format)
  5. getTimestampFormat()
  6. getTimeStampFormat(Date date)
  7. getTimestampFormat(long time)
  8. sortedTimestampFormat(Date date)
  9. stringConvertToTimestamp(String value, String format)