Java Now toStr2(Date now)

Here you can find the source of toStr2(Date now)

Description

to Str

License

Apache License

Declaration

public static String toStr2(Date now) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    private static SimpleDateFormat dateFomat2 = new SimpleDateFormat("yyyyMMdd");

    public static String toStr2(Date now) {
        String s = "";
        try {/* ww  w  . j av  a 2s .  co m*/
            s = dateFomat2.format(now);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return s;
    }
}

Related

  1. nowTime(String formartStr)
  2. nowTime(String format)
  3. printNow()
  4. stringDate(Date now)
  5. subNow()
  6. toString(Date now)