Java Now now()

Here you can find the source of now()

Description

now

License

Apache License

Declaration

public static String now() 

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 now() {
        return datetimeToStr(new Date());
    }/* w w  w .  j av a 2  s .c  o m*/

    // ===============================================================
    public static String datetimeToStr(Date dtSource) {
        // 'yyyy-mm-dd hh:nn:ss'
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
        return formatter.format(dtSource);
    }
}

Related

  1. now()
  2. now()
  3. now()
  4. now()
  5. now()
  6. now()
  7. now()
  8. now()
  9. now()