求告知这段java代码到底做了什么,能每行备注最好,谢谢了

/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.

package com.sanqing.common;

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

// Referenced classes of package com.sanqing.common:
// Debug

public class DateUtil
{

public DateUtil()
{
}

public static String getNowDate()
{
Date dateTime = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String strTime = format.format(dateTime);
Debug.writeLog(strTime);
return strTime;
}

public static String getStringDate()
{
Date dateTime = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String strTime = format.format(dateTime);
return strTime;
}

public static String getStringDateShort()
{
Date dateTime = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String strTime = format.format(dateTime);
return strTime;
}
}

/*
DECOMPILATION REPORT

Decompiled from: D:\old\javaprj\JavaPrj_14\WebRoot\WEB-INF\lib\sanqing.jar
Total time: 203 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
*/

package com.sanqing.common;

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

// Referenced classes of package com.sanqing.common:
//            Debug

public class DateUtil
{

    // 空的构造函数
    public DateUtil()
    {
    }

    // 取得当前时间(年月日时分秒)
    public static String getNowDate()
    {
        // new了一个Date对象dateTime
        Date dateTime = new Date();
        // new了一个format对象
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 把dateTime格式化成字符串
        String strTime = format.format(dateTime);
        
        // 往日志里写入这个时间字符串
        Debug.writeLog(strTime);
        
        //  返回该时间字符串
        return strTime;
    }

    // 取得一个时间字符串(年月日时分)和上面的函数区别是没有秒
    // 里面的实现和上面的函数实现,基本是一样的
    public static String getStringDate()
    {
        Date dateTime = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String strTime = format.format(dateTime);
        return strTime;
    }
     
    // 取得一个时间字符串(年月日),和上面的区别是只有日期
    // 里面的实现和上面的函数实现,基本是一样的
    public static String getStringDateShort()
    {
        Date dateTime = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String strTime = format.format(dateTime);
        return strTime;
    }
}

// 下面都是注释,不用看。
/*
DECOMPILATION REPORT

Decompiled from: D:\old\javaprj\JavaPrj_14\WebRoot\WEB-INF\lib\sanqing.jar
Total time: 203 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
*/
温馨提示:答案为网友推荐,仅供参考