Java Now subNow()

Here you can find the source of subNow()

Description

sub Now

License

Open Source License

Declaration

public static String subNow() 

Method Source Code

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

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

public class Main {
    static SimpleDateFormat dateFomaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String subNow() {
        return getNow().substring(0, 10);
    }/*from   w ww.  j a v a  2 s  . co  m*/

    public static String getNow() {

        return dateFomaFormat.format(new Date());

    }
}

Related

  1. nowString(String pattern)
  2. nowTime(String formartStr)
  3. nowTime(String format)
  4. printNow()
  5. stringDate(Date now)
  6. toStr2(Date now)
  7. toString(Date now)