<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 閱讀(131) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(10)

    隨筆檔案

    文章分類(lèi)

    文章檔案

    相冊(cè)

    收藏夾

    java

    搜索

    •  

    最新評(píng)論


    主站蜘蛛池模板: 噼里啪啦电影在线观看免费高清| 91精品免费久久久久久久久| 亚洲国产成人精品青青草原| 丝袜捆绑调教视频免费区| 亚洲国产免费综合| 香蕉视频在线观看免费国产婷婷| 免费看AV毛片一区二区三区| 亚洲精品美女网站| 热99re久久免费视精品频软件| 亚洲伊人久久大香线蕉AV| 中文字幕久精品免费视频| 在线播放免费人成视频在线观看| 中文字幕乱码亚洲精品一区| 日韩视频在线免费观看| 亚洲一区二区三区影院 | 亚洲欧美在线x视频| 国产精品国产午夜免费福利看| 国产精一品亚洲二区在线播放| 国产精品区免费视频| 亚洲综合一区二区精品久久| 性一交一乱一视频免费看| 美女的胸又黄又www网站免费| 国产亚洲精品激情都市| 久爱免费观看在线网站| 亚洲一区动漫卡通在线播放| 一区二区三区无码视频免费福利 | 国产精品美女午夜爽爽爽免费| 亚洲国产精品无码久久久秋霞1| 黄+色+性+人免费| 亚洲av日韩专区在线观看| 无码国产精品一区二区免费虚拟VR | 美女黄频a美女大全免费皮| 在线A亚洲老鸭窝天堂| 91精品国产免费入口| 亚洲AV无码片一区二区三区| 亚洲性日韩精品国产一区二区| 蜜桃成人无码区免费视频网站| 国产精品亚洲专区无码牛牛 | 两个人看的www免费视频| 亚洲AV伊人久久青青草原| 久久久久久免费一区二区三区|