Java Hour Format formatInfo(String info)

Here you can find the source of formatInfo(String info)

Description

format Info

License

Open Source License

Declaration

public static String formatInfo(String info) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

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

    public static String formatInfo(String info) {
        return getCurDateTime() + " : " + info + "\n";
    }/*ww w .j  a v a  2  s  . co m*/

    public static String getCurDateTime() {
        return getCurDateTime(DEFAULT_PATTERN);
    }

    public static String getCurDateTime(String formatStr) {
        SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
        String now = sdf.format(new Date());
        return now;
    }
}

Related

  1. formatHttpDate(Date date)
  2. formatHttpDate(Date date)
  3. formatHttpDate(Date date)
  4. formatHTTPDate(Date date)
  5. formatHTTPDate(Date pTime)
  6. formatInternal(final Date date)
  7. formatInterval(long intervalMsec)
  8. formatLastModified(long lastModifiedTime)
  9. formatMessage(String message)