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

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

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


    posts - 15,  comments - 34,  trackbacks - 27

    A Date object represents a precise moment in time, down to the millisecond. Dates are represented as a long that counts the number of milliseconds since midnight, January 1, 1970, Greenwich Mean Time.

    Does this have a year 2000 problem? If so in what year?

    To create a Date object for the current date and time use the noargs Date() constructor like this:

    Date now = new Date();

    To create a Date object for a specific time, pass the number of milliseconds since midnight, January 1, 1970, Greenwich Meantime to the constructor, like this:

    Date midnight_jan2_1970 = new Date(24L*60L*60L*1000L);

    You can return the number of milliseconds in the Date as a long, using the getTime() method. For example, to time a block of code, you might do this

    Date d1 = new Date(); // timed code goes here Date d2 = new Date(); long elapsed_time = d2.getTime() - d1.getTime(); System.out.println("That took " + elapsed_time + " milliseconds");

    You can change a Date by passing the new date as a number of milliseconds since midnight, January 1, 1970, GMT, to the setTime() method, like this:

    Date midnight_jan2_1970 = new Date(); midnight_jan2_1970.setTime(24L*60L*60L*1000L);

    The before() method returns true if this Date is before the Date argument, false if it's not. For example

    if (midnight_jan2_1970.before(new Date())) { 

    The after() method returns true if this Date is after the Date argument, false if it's not. For example

    if (midnight_jan2_1970.after(new Date())) { 

    The Date class also has the usual hashCode(), equals(), and toString() methods.

    posted on 2005-02-04 11:39 jacky 閱讀(128) 評論(0)  編輯  收藏

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


    網站導航:
     
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(10)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    java

    搜索

    •  

    最新評論


    主站蜘蛛池模板: 四虎精品免费永久免费视频| 亚洲人成小说网站色| 一级毛片高清免费播放| 波多野结衣中文一区二区免费 | 亚洲AV午夜成人片| 国产亚洲免费的视频看| 亚洲av伊人久久综合密臀性色| baoyu116.永久免费视频| 亚洲精品蜜桃久久久久久| 热99RE久久精品这里都是精品免费| 亚洲精品国产美女久久久| 高清一区二区三区免费视频| 亚洲∧v久久久无码精品| 91视频免费网址| 99久久国产亚洲综合精品| 国产伦精品一区二区三区免费下载| 在线观看亚洲精品专区| 在线观看国产区亚洲一区成人| 成人免费一区二区三区| 久久青青草原亚洲av无码app| 99久久久国产精品免费牛牛四川| 亚洲综合小说久久另类区| 成人五级毛片免费播放| 美女18毛片免费视频| 亚洲av综合色区| 色se01短视频永久免费| 国产精品无码亚洲精品2021| 久久影视综合亚洲| h片在线免费观看| 99亚洲精品卡2卡三卡4卡2卡| 亚洲线精品一区二区三区| 18女人毛片水真多免费| 亚洲精品久久无码| 国产亚洲综合成人91精品| 国产一卡二卡3卡四卡免费| 在线播放免费人成视频网站| 亚洲视频手机在线| 亚洲av高清在线观看一区二区| 毛片免费在线观看| 亚洲av乱码一区二区三区按摩 | 免费观看成人久久网免费观看|