56 salesforce學習筆記(三)

2021-08-09 07:13:21 字數 3557 閱讀 5534

date型別

datetime nowdatetime =datetime.now();

datetime datetime1 = datetime.newinstance(2015,3,1,13,26,0);

string datetimestring = '2016-3-1 pm14:38';

system.debug('通過初始化年月日時分秒得到的datetime,並轉換格式到:'+datetime1.format('yyyy-mm-dd hh:mm:ss'));

datetime1 = datetime1.adddays(1);

datetime1 = datetime1.addmonths(1);

datetime1 = datetime1.addyears(1);

datetime1 = datetime1.addhours(1);

datetime1 = datetime1.addminutes(1);

datetime1 = datetime1.addseconds(1);

date date1 =datetime1.date();

system.debug('datetime1對應的date為:'+date1.format());

date dategmt =datetime1.dategmt();

system.debug('datetime1對應的dategmt值為:'+dategmt.format());

integer year =datetime1.year();

integer yeargmt =datetime1.yeargmt();

integer month =datetime1.month();

integer monthgmt =datetime1.monthgmt();

integer day =datetime1.day();

integer daygmt =datetime1.daygmt();

integer dayofyear =datetime1.dayofyear();

integer dayofyeargmt =datetime1.dayofyeargmt();

integer hour =datetime1.hour();

integer hourgmt =datetime1.hourgmt();

integer minute =datetime1.minute();

integer minutegmt =datetime1.minutegmt();

integer second =datetime1.second();

integer secondgmt =datetime1.secondgmt();

system.debug('year:'+year+'\tyeargmt:'+yeargmt);

system.debug('month:'+month+'\tmonthgmt:'+monthgmt);

system.debug('day:'+day+'\tdaygmt:'+daygmt);

system.debug('hour:'+hour+'\thourgmt:'+hourgmt);

system.debug('minute:'+minute+'\tminutegmt:'+minutegmt);

system.debug('second:'+second+'\tsecondgmt:'+secondgmt);

system.debug('dayofyear:'+dayofyear+'\tdayofyeargmt:'+dayofyeargmt);

system.debug('轉成本地日期並以長日期型別顯示:'+datetime1.formatlong());

long timel =datetime1.gettime();

system.debug('轉成time型別的long型別顯示為:'+timel.format());

datetime datetime5 = datetime.newinstance(2016, 4 ,2);

system.debug('datetime1與datetime2是否同一天:'+datetime1.issameday(datetime5));

結果如下所示

date型別

date date2 =date.today();

system.debug('當前日期:'+date2.format());

date date3 = date.newinstance(2016, 3, 1);

string datestring = '2016-3-1';

date date4 =date.parse(datestring);

date date5 =date.valueof(datestring);

system.debug('通過newinstance例項化:'+date3.format());

system.debug('通過parse例項化:'+date4.format());

system.debug('通過valueof例項化' +date5.format());

date3 = date3.addmonths(1);

date3 = date3.adddays(1);

system.debug('date3的日期為:' +date3.format());

integer year1 =date3.year();

integer month1 =date3.month();

integer day1 =date3.day();

system.debug('year:'+year1);

system.debug('month:'+month1);

system.debug('day:'+day1);

integer dayofyear1 =date3.dayofyear();

system.debug('dayofyear :' +dayofyear1);

integer daysbetween = date3.daysbetween(date4);//

date4-date3

system.debug('date3和date4相差天數:'+daysbetween);

system.debug('date4和date5是否相同日期:'+date4.issameday(date5));

system.debug('date3和date4相差月數:'+date3.monthsbetween(date4));

system.debug('呼叫tostartofmonth執行值:'+date3.tostartofmonth().format());

system.debug('呼叫tostartofweek執行值:' + date3.tostartofweek().format());

結果如下所示

56 筆記 MySQL學習 布林模式全文搜尋

56.筆記 mysql學習 布林模式全文搜尋 布林模式有以下特點 l 即使找到的單詞會出現在一半以上的行裡,仍然會把它們搜搜出來 l 查詢結果不再按相關程式排序 l 搜尋可以要求短語裡的所有單詞都必須是按某種特定的順序出現 l 可以對未包括在fulltex索引裡的那些列,進行布林模式全文搜尋 如果要...

Salesforce學習第一天

好久沒有在發布學習部落格了,開學事情多,奇葩心思多嘛,諒解。現在在一家公司實習salesforce開發,每天都在看英文文件,然後學著操作,只可惜沒人能培訓下,學習起來進度比較慢。英文的文件看的思緒亂,不做下筆記實在不行,今天起就發發部落格記錄下學習心得吧,可能部落格中很多內容很簡單或者說有錯,不過沒...

salesforce零基礎學習(九十一)Facet

說facet以前,我們先說一下瀏覽器載入解析以及渲染的過程。瀏覽器獲取乙個html的檔案時,會按照自上向下的順序進行解析,並在載入過程中進行渲染。對html解析成dom樹,對css 解析成css rule樹,然後通過dom數以及css rule樹構造rendering樹。接下來轉回facet,fac...