Use the Date java study.

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Date use, we should pay attention to the date format, otherwise it returns the default format. Please refer to the API documentation.

import java.util.*;
import java.text.*;
public class TestDate
	public static void main(String[] args)
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat ("yyy-MM-DD hh:ss:mm");
  //The format can be modified according to their own needs, SimpleDateFormat method is to change the system date format to the format you want. 

String s = sdf.format(date); System.out.println(date); System.out.println(s); } }

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Caspar at November 18, 2013 - 11:30 PM