<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 33,  comments - 17,  trackbacks - 0
     1/**
     2 * 取得服務器當前的各種具體時間
     3 * 回車:日期時間
     4 */

     5
     6import java.util.*;
     7
     8public class GetNowDate{
     9    Calendar  calendar = null;
    10  
    11    public GetNowDate(){
    12        calendar = Calendar.getInstance();
    13        calendar.setTime(new Date());
    14    }

    15  
    16    public int getYear(){
    17        return calendar.get(Calendar.YEAR);
    18    }

    19  
    20    public int getMonth(){
    21        return 1 + calendar.get(Calendar.MONTH);
    22    }

    23  
    24    public int getDay(){
    25        return calendar.get(Calendar.DAY_OF_MONTH);
    26    }

    27  
    28    public int getHour(){
    29        return calendar.get(Calendar.HOUR_OF_DAY);
    30    }

    31    
    32    public int getMinute(){
    33        return calendar.get(Calendar.MINUTE);
    34    }

    35  
    36    public int getSecond(){
    37        return calendar.get(Calendar.SECOND);
    38    }

    39    
    40    public String getDate(){
    41        return getMonth()+"/"+getDay()+"/"+getYear();
    42    }

    43  
    44    public String getTime(){
    45        return getHour()+":"+getMinute()+":"+getSecond();
    46    }

    47  
    48    public String getDate2(){
    49        String yyyy="0000", mm="00", dd="00";
    50        yyyy = yyyy + getYear();
    51        mm   = mm   + getMonth();
    52        dd   = dd + getDay();
    53        yyyy = yyyy.substring(yyyy.length()-4);
    54        mm   = mm.substring(mm.length()-2);
    55        dd   = dd.substring(dd.length()-2);
    56        return yyyy + "/" + mm + "/" +  dd;
    57    }

    58  
    59    public String getTime2(){
    60        String hh="00", mm="00", ss="00";
    61        hh = hh + getHour();
    62        mm = mm + getMinute();
    63        ss = ss + getSecond();
    64        hh = hh.substring(hh.length()-2, hh.length());
    65        mm = mm.substring(mm.length()-2, mm.length());
    66        ss = ss.substring(ss.length()-2, ss.length());
    67        return hh + ":" + mm + ":" + ss;
    68    }

    69}
    posted on 2008-07-23 17:34 scea2009 閱讀(107) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    <2008年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    PL/SQL存儲過程與函數

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲自偷自偷在线成人网站传媒| 亚洲精品无码久久久久去q| 亚洲爆乳成av人在线视菜奈实| 综合一区自拍亚洲综合图区| 在人线av无码免费高潮喷水| 亚洲人成黄网在线观看| 亚洲一区二区三区免费视频| 亚洲成AV人片在WWW色猫咪| 国产啪精品视频网站免费尤物 | 久热中文字幕在线精品免费| 亚洲国产女人aaa毛片在线| 久久青草精品38国产免费| 亚洲男人都懂得羞羞网站| 国内精品一级毛片免费看| 亚洲成a人片77777老司机| 88xx成人永久免费观看| 亚洲Av无码乱码在线znlu| 香蕉视频在线观看免费| 中文字幕亚洲不卡在线亚瑟| 韩日电影在线播放免费版| 中文字幕人成人乱码亚洲电影| 中文字幕在线视频免费| 亚洲AV无码成人专区片在线观看 | 免费A级毛片无码专区| 亚洲一二成人精品区| 青青视频观看免费99| 亚洲sm另类一区二区三区| 亚洲AV无码乱码精品国产| 日韩精品无码免费专区午夜不卡 | 亚洲一区在线观看视频| 日韩电影免费在线| 国产日韩在线视频免费播放| 亚洲今日精彩视频| 全免费a级毛片免费看无码| 亚洲线精品一区二区三区影音先锋| 最近更新免费中文字幕大全| 亚洲日本国产乱码va在线观看| 无码精品一区二区三区免费视频| 亚洲欧洲春色校园另类小说| 国产免费黄色大片| 免费播放一区二区三区|