<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      unix時間戳是從1970年1月1日(UTC/GMT的午夜)開始所經過的秒數,不考慮閏秒。

      在大多數的UNIX系統中UNIX時間戳存儲為32位,這樣會引發2038年問題。

      但是,因為需求是需要int類型的UNIX時間戳。 開始的時候我是這樣設計的。

      /**
      	 * 獲取當前事件Unxi 時間戳
      	 * @return
      	 */
      	public static int getUnixTimeStamp(){
      		long rest=System.currentTimeMillis()/1000L;
      		return (int)rest;
      	}
      

       從新封裝了一些方法。如下穩定性就好很多了。

       1 package com.xuanyuan.utils;
       2 
       3 public class TimeUtils {
       4     
       5       /**
       6      * Constant that contains the amount of milliseconds in a second
       7      */
       8     static final long ONE_SECOND = 1000L;
       9 
      10     /**
      11      * Converts milliseconds to seconds
      12      * @param timeInMillis
      13      * @return The equivalent time in seconds
      14      */
      15     public static int toSecs(long timeInMillis) {
      16         // Rounding the result to the ceiling, otherwise a
      17         // System.currentTimeInMillis that happens right before a new Element
      18         // instantiation will be seen as 'later' than the actual creation time
      19         return (int)Math.ceil((double)timeInMillis / ONE_SECOND);
      20     }
      21 
      22     /**
      23      * Converts seconds to milliseconds, with a precision of 1 second
      24      * @param timeInSecs the time in seconds
      25      * @return The equivalent time in milliseconds
      26      */
      27     public static long toMillis(int timeInSecs) {
      28         return timeInSecs * ONE_SECOND;
      29     }
      30 
      31     /**
      32      * Converts a long seconds value to an int seconds value and takes into account overflow
      33      * from the downcast by switching to Integer.MAX_VALUE.
      34      * @param seconds Long value
      35      * @return Same int value unless long > Integer.MAX_VALUE in which case MAX_VALUE is returned
      36      */
      37     public static int convertTimeToInt(long seconds) {
      38         if (seconds > Integer.MAX_VALUE) {
      39             return Integer.MAX_VALUE;
      40         } else {
      41             return (int) seconds;
      42         }
      43     }
      44 
      45 }

       

      posted on 2016-12-26 21:51  高山月小  閱讀(17010)  評論(0)    收藏  舉報

      主站蜘蛛池模板: 人人爽人人爽人人片a免费| 亚欧乱色国产精品免费九库| 美女扒开尿口让男人桶| 欧美videos粗暴| 婷婷色综合成人成人网小说| 亚洲sm另类一区二区三区| 亚洲欧洲精品一区二区| 九九热精品在线观看| 女人腿张开让男人桶爽| 亚洲综合一区无码精品| 夜夜影院未满十八勿进| 湘西| 开心婷婷五月激情综合社区| 成人免费xxxxx在线观看| 青青草国产线观看| 贡山| 国产精品伦人一久二久三久| 色欲国产精品一区成人精品| 伊人久久精品无码二区麻豆| 激情六月丁香婷婷四房播| 91色老久久精品偷偷性色| 日韩国产中文字幕精品| 成人无码午夜在线观看| 九九热精品免费视频| 亚洲中文精品一区二区| 97无码人妻福利免费公开在线视频| 亚洲高清有码中文字| 九九热在线免费视频播放| 男人猛躁进女人免费播放| 人人人澡人人肉久久精品| 午夜福利国产精品小视频| 伊人久久精品一区二区三区| 3d无码纯肉动漫在线观看| 成人欧美日韩一区二区三区| 色综合 图片区 小说区| 亚洲精品无码成人A片九色播放| 无码视频一区二区三区| 亚洲精品一区二区动漫| 性色av无码久久一区二区三区| 国内熟妇人妻色在线视频| 精品国精品国自产在国产|