Source Code : Format Date() in long

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Format Date() in long


import java.text.MessageFormat;
import java.util.Date;

public class Main {
  public static void main(String[] argv) throws Exception {
    Object[] params = new Object[] { new Date(), new Date(0) };
    String msg = MessageFormat.format("{0,time,long} and UTC of 0 is {1,time,long}", params);

    System.out.println(msg);
  }
}
//8:31:27 PDT AM and UTC of 0 is 4:00:00 PST PM

 

Thank with us