Java Date Now getNowDateString(String sign)

Here you can find the source of getNowDateString(String sign)

Description

get Now Date String

License

Apache License

Declaration

public static String getNowDateString(String sign) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getNowDateString(String sign) {
        SimpleDateFormat formatter;
        formatter = new SimpleDateFormat("yyyy" + sign + "MM" + sign + "dd");
        String dateString = formatter.format(new Date());
        return dateString.trim();
    }//  w w w. java2 s  .  c  o m
}

Related

  1. getNowDate()
  2. getNowDate(String format)
  3. getNowDate(String format)
  4. getNowDateShort()
  5. getNowDateStr(String formatStr)