System.out.print(
new java.text.SimpleDateFormat('mm/dd/yyyy').format(new Date());
)

解决方案 »

  1.   

    不知道你要在什么环境下格式输出
    如果在delphi下应当有个FormatDateTime函数
    下面是delphi自带的帮助example
    S := FormatDateTime('"The meeting is on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM',   StrToDateTime('2/15/95 10:30am'));
    如果是oracle数据库
    可以用to_char(date_column_name,format_string);
       如:format_string='yyyy/mm/dd hh24:mi:ss' 
           表示输出:年年年年/月月/日日 24小时制小时时:分:秒
      

  2.   

    import java.util.*;
    import java.text.*;
    class a{
      System.out.println(new SimpleDateFormat("mm/dd/yyyy").format(new Date()) );
    }