時間操作函式

2021-05-01 01:57:36 字數 687 閱讀 4828

var mydate = new date();

mydate.getyear();       //獲取當前年份(2位)

mydate.getfullyear();   //獲取完整的年份(4位,1970-????)

mydate.getmonth();      //獲取當前月份(0-11,0代表1月)

mydate.getdate();       //獲取當前日(1-31)

mydate.getday();        //獲取當前星期x(0-6,0代表星期天)

mydate.gettime();       //獲取當前時間(從1970.1.1開始的毫秒數)

mydate.gethours();      //獲取當前小時數(0-23)

mydate.getminutes();    //獲取當前分鐘數(0-59)

mydate.getseconds();    //獲取當前秒數(0-59)

mydate.getmilliseconds();   //獲取當前毫秒數(0-999)

mydate.tolocaledatestring();    //獲取當前日期

var mytime=mydate.tolocaletimestring();    //獲取當前時間

mydate.tolocalestring( );       //獲取日期與時間 

hive 時間操作函式

日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 從1970 01 01 00 00 00 utc到指定時間的秒數 到當前時區的時間格式 舉例 hi...

hive時間操作函式

標籤 hive 函式linux 2016 12 21 16 07 49人閱讀收藏 舉報 hive 日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 ...

hive 時間操作函式

日期函式unix時間戳轉日期函式 from unixtime語法 from unixtime bigint unixtime string format 返回值 string 說明 轉化unix時間戳 從1970 01 01 00 00 00 utc到指定時間的秒數 到當前時區的時間格式 舉例 hi...