Here you can find the source of formatDateLog(String dateStr)
[
" and ends with "]
".
Parameter | Description |
---|---|
dateStr | a parameter |
public static String formatDateLog(String dateStr)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt public class Main { /**//from w ww .java 2s . c o m * Formats the date string to the string that begins with "<code>[</code>" and ends with "<code>]</code>". The * string of returning is like <code>[2012-5-24 11:39:22]</code>. If <code>dateStr</code> is <code>null</code>, then * the returned string is <code>[null]</code>. * * @param dateStr * @return a string. */ public static String formatDateLog(String dateStr) { StringBuffer sb = new StringBuffer(""); sb.append("["); sb.append(dateStr); sb.append("]"); return sb.toString(); } }