API其他函式 ,system date,

2021-07-03 17:31:30 字數 914 閱讀 4235

system:

out:標準輸出流,預設的對應裝置是顯示器

int: 標準輸入流,預設裝置是鍵盤

system.getproperties(); 獲取到的系統資訊儲存到properties鍵值集合中

properties prop =system.getproperties();

setkeyset=prop.stringpropertyname();

****runtime 就是單例設計模式的物件

runtime r= runtime.getruntime();

r.exec("winmine.exe");

****math******

int d=(int)math.ceil(math.random()*6); // 1~6

日期的格式化:

想要把日期按照我們的習慣格式化一下,找到了dateformat

date date = new date()

// 通過dateformat 類的靜態工廠方法獲取例項

dateformat dateformat= dateformat.getdateinstance(dateformat.full);

;// 轉成自定義格式,***/xx/xx ,自定義物件,只有子類

dateformat = new ******dateformat("yyyy/mm/dd hh:mm:ss");

//使用dateformate的format 方法對日期物件進行格式化。//將日期物件轉成日期格式的字串

string str_date =dateformat.format(date);

c.set(calender.year,2014);

c.set(2014,2,1);

c.add(calendar.day_of_month,-1);  //向左偏移一天

jquery 其他api操作

筆記整理,供以後參閱 aaaa bbbb cccc 刪除 size x large color darkred 2.樣式css和屬性attr color size jquery hellojquery hellojquery abcd size x large color darkred 3.htm...

MySQL函式 其他函式

1 格式化函式format x,n format x,n 函式可以將數字x進行格式化,將x保留到小數點後n位。select format 3.1415926,3 3.142 2 不同進製的數字進行轉換 ascii s 返回字串s的第乙個字元的ascii碼 bin x 返回x的二進位制編碼 hex x...

Mysql 其他函式

mysql 中的數值函式 abs x 返回x的絕對值 ceil x 返回大於x的最新整數值 floor x 返回小於x的最小整數值 mod x,y 返回x對y取餘的值 rand 返回0 1間的隨機數 round x,y 返回引數x的四捨五入值,保留y位小數 truncate x,y 返回引數x截斷為...