ext date java解析_Ext.Date 方法

1.Ext.Date.add(date,interval,value);  提供执行基本日期运算的简便方法; date 日期对象, interval 一个有效的日期间隔枚举值, value 向当前日期上增加的总数

//基本用法:

var dt = Ext.Date.add(new Date('9/20/2016'), Ext.Date.DAY, 5);//增加5天//返回 'Sun Sep 25 2016 00:00:00 GMT+0800 (中国标准时间)'

//负数将按照减法运算:

var dt2 = Ext.Date.add(new Date('9/20/2016'), Ext.Date.DAY, -5);//减少5天//返回 'Thu Sep 15 2016 00:00:00 GMT+0800 (中国标准时间)'

var date = Ext.Date.add(new Date('9/20/2016'), Ext.Date.YEAR, 2);//增加2年//返回 'Thu Sep 20 2018 00:00:00 GMT+0800 (中国标准时间)'

2.Ext.Date.between(date,start,end);  检查指定日期表示的时间是否在开始日期和结束日期之内

var date = new Date('9/20/2016');var start = new Date('9/1/2016');var end = new Date('10/10/2016');

Ext.Date.between(date, start, end);//返回true

3.Ext.Date.clone(date);  创建并返回一个指定日期对象的克隆

var date = new Date("9/20/2016");var copy = Ext.Date.clone(date); //克隆一个值

4.Ext.Date.clearTime(date,clone);   清除指定日期的时间信息;clone 为true则创建一个当前日期对象的克隆,然后清除克隆对象的时间信息并将克隆对象返回,当前日期对象不受影响,默认false;

var date = new Date(9/20/2016 16:55:00);

Ext.Date.clearTime(date);//Tue Sep 20 2016 00:00:00 GMT+0800 (中国标准时间)

Ext.Date.clearTime(date,true);//Tue Sep 20 2016 00:00:00 GMT+0800 (中国标准时间)

5.Ext.Date.format(date,format);  按指定的格式化字符串 格式化日期,返回指定格式的日期字符串

var date = new Date("9/20/2016 16:55:00");//format 日期格式,Y-年,m-月,d-日,H-24小时,i-分钟,s-秒

Ext.Date.format(date, 'Y-m-d H:i'); //"2016-09-20 16:55"

Ext.Date.format(date, 'Y年m月d日 H:i:s'); //2016年09月20日 16:55:00

6.Ext.Date.formatContainsHourInfo(format);  检查格式字符串中是否包含钟点信息,包含返回true 否则返回false

Ext.Date.formatContainsHourInfo("Y-m-d"); //false

Ext.Date.formatContainsHourInfo("Y-m-d H:i"); //true

7.Ext.Date.formatContainsDateInfo(format);  检查格式字符串中是否包含日期信息,包含返回true 否则返回false

Ext.Date.formatContainsDateInfo("Y-m-d"); //true

Ext.Date.formatContainsDateInfo("H:i:s"); //false

8.Ext.Date.getElapsed(dateA,[dateB]);  返回两个日期之间的毫秒数; dateB 可选 默认为当前日期

var dateA = new Date("2016/09/20");var dateB = new Date("2016/09/21");

Ext.Date.getElapsed(dateA,dateB);//86400000

9.Ext.Date.getShortMonthName(month);  根据月份数返回对应的月份短名; month:Number

Ext.Date.getShortMonthName(0); //一月

10.Ext.Date.getShortDayName(day);  根据月份数返回对应的星期短名; day:Number

Ext.Date.getShortDayName(0); //星期日

Ext.Date.getShortDayName(6); //星期六

10.Ext.Date.getMonthNumber(name); 根据月份的短名或全名返回从零开始的月份数值

11.Ext.Date.getTimezone(date);  获取时区

12.Ext.Date.getDayOfYear(date);  返回当前年份中天数的数值,已经根据闰年调整过 范围0-364(闰年365)

var date1 = new Date("2016/1/1");var date2 = new Date("2016/9/20");

Ext.Date.getDayOfYear(date1);//0

Ext.Date.getDayOfYear(date2); //263

13.Ext.Date.getWeekOfYear(date);  从年份中获取 ISO-8601 标准的星期数。取得指定日期是所在年份中第几个星期 范围1-53

var date1 = new Date("2016/1/1");var date2 = new Date("2016/2/1");

Ext.Date.getWeekOfYear(date1);//53

Ext.Date.getWeekOfYear(date2); //5

14.Ext.Date.getFirstDayOfMonth(date);  返回当前月份第一天的星期数; 0代表星期日

var date = new Date("2016/1/1");

Ext.Date.getFirstDayOfMonth(date);//5

15.Ext.Date.getLastDayOfMonth(date);  返回当前月份最后一天的星期数; 0代表星期日

var date = new Date("2016/1/1");

Ext.Date.getLastDayOfMonth(date);//0

16.Ext.Date.getFirstDateOfMonth(date);  返回当前月份中第一天的日期对象。

var date = new Date("2016/9/20");

Ext.Date.getFirstDateOfMonth(date);//Thu Sep 01 2016 00:00:00 GMT+0800 (中国标准时间)

17.Ext.Date.getLastDateOfMonth(date);  返回当前月份中最后一天的日期对象。

var date = new Date("2016/9/20");

Ext.Date.getLastDateOfMonth(date);//Fri Sep 30 2016 00:00:00 GMT+0800 (中国标准时间)

18.Ext.Date.getDaysInMonth(date);  返回当前月份的总天数

var date = new Date("2016/9/20");

Ext.Date.getDaysInMonth(date);//30

19.Ext.Date.getSuffix(date);  返回当天的英文单词的后缀

var date = new Date("2016/9/20");

Ext.Date.getSuffix(date);//"th"

20.Ext.Date.isLeapYear(date);  判断指定日期所在年是不是闰年

var date = newDate();

Ext.Date.isLeapYear(date);//true

21.Ext.Date.isDST(date);  检查指定日期是否受夏令时影响

var date = newDate();

Ext.Date.isDST(date);//false

22.Ext.Date.isValid(date);  //检查传入的参数是否可以转换为一个有限的Js日期对象

Ext.Date.isValid(2016,10,1,20,10,10); //true

Ext.Date.isValid(2016,13,32,20,10,10); //false

23.Ext.Date.now();  返回当前时间 毫秒数

Ext.Date.now(); //1474423758166

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
insert overwrite table discountdw.dwd_sd_adds_order_bill_inc partition(dt = '2023-06-06') select t1.order_bill_id, t1.counterfoil_no, t1.acceptor, date_format(to_utc_timestamp(cast(t1.expiry_date as bigint) ,'GMT-8'),'YYYY-MM-dd'), t2.company_id, t1.cert_no, t1.company_name, t1.third_order_id, t1.counterfoil_amt/10000, t1.transaction_amt/10000, t1.rate, '3bp' as service_tariffing, ((DATEDIFF(to_utc_timestamp(t1.expiry_date ,'GMT-8'),to_utc_timestamp(t1.transaction_date ,'GMT-8') ) + adjust_days)* 0.0003 *(counterfoil_amt))/ 360 as service_fee, 360 as total_days, DATEDIFF(to_utc_timestamp(t1.expiry_date ,'GMT-8'),to_utc_timestamp(t1.transaction_date ,'GMT-8') ) + adjust_days as modulation_date, t3.channel_type, t3.bank_name, date_format(to_utc_timestamp(cast(t1.transaction_date as bigint) ,'GMT-8'),'YYYY-MM-dd'), t1.order_status_code, t1.order_status_msg, t4.fee_amt, t4.status, t1.tenant_id, t5.revenue, to_utc_timestamp(cast(t1.create_date as bigint) ,'GMT-8'), to_utc_timestamp(cast(t1.update_date as bigint) ,'GMT-8') from (select * from discountdw.ods_adds_order_bill_inc where dt ='2023-06-06' and channel_id=101110004 )t1 left join (select * from mecdw.ods_company_full where platform_id='sdpjw')t2 on t1.cert_no=t2.cert_no and t1.tenant_id=t2.tenant_id left join discountdw.dim_adds_product_full t3 on t1.partner_id=t3.partner_id and t1.product_id=t3.product_id left join (select * from mecdw.dwd_sc_fee_record_full where dt='2023-06-06' and biz_type=2 ) t4 on t1.order_bill_id=t4.third_id left join (select * from discountdw.ods_sd_order_ext_inc where dt='2023-06-06') t5 on t1.order_bill_id=t5.order_bill_id left join sdpjwdw.dim_holiday_info_full t6 on date_format(to_utc_timestamp(t1.expiry_date ,'GMT-8'),'YYYY-MM-dd') = t6.civic_holiday ;
最新发布
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值