当前位置: 首页 > news >正文

大连网站建设主页建设彩票网站需要多少投资

大连网站建设主页,建设彩票网站需要多少投资,微信网站建设计入什么科目,企业推广网java使用Calendar类获得指定日期 关于指定日期的获取#xff0c;是根据指定日期和当前日期相差的天数#xff0c;然后使用set方法设置Calendar.DAY_OF_MONTH的值。Calendar cal Calendar.getInstance();cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - da… java使用Calendar类获得指定日期    关于指定日期的获取是根据指定日期和当前日期相差的天数然后使用set方法设置Calendar.DAY_OF_MONTH的值。    Calendar cal Calendar.getInstance();    cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH) - dayPlus);    (dayPlus表示指定日期和当前日期相差的天数)    不进行set默认是获取系统时间初步测试没有问题可正确获得指定日期。    *************************************************************************************************    代码    // 获得当前日期    public static String getDate() {        Calendar cal Calendar.getInstance();        return getDate(cal);    }    // 获得日期    private static String getDate(Calendar cal) {        String v_strDate ;        int v_intYear cal.get(Calendar.YEAR);        int v_intMonth cal.get(Calendar.MONTH) 1;        int v_intDAY cal.get(Calendar.DAY_OF_MONTH);        int v_intHOUR cal.get(Calendar.HOUR_OF_DAY);        int v_intMINUTE cal.get(Calendar.MINUTE);        int v_intSECOND cal.get(Calendar.SECOND);                if (v_intDAY 10) {            v_strDate v_strDate 0 v_intDAY -;        }else {            v_strDate v_strDate v_intDAY -;        }        if (v_intMonth 10) {            v_strDate v_strDate 0 v_intMonth -;        }else {            v_strDate v_strDate v_intMonth -;        }        v_strDate v_strDate v_intYear ;                if (v_intHOUR 10) {            v_strDate v_strDate 0 v_intHOUR :;        }else {            v_strDate v_strDate v_intHOUR :;        }        if (v_intMINUTE 10) {            v_strDate v_strDate 0 v_intMINUTE :;        } else {            v_strDate v_strDate v_intMINUTE :;        }        if (v_intSECOND 10) {            v_strDate v_strDate 0 v_intSECOND;        } else {            v_strDate v_strDate v_intSECOND;        }        cal null;        return v_strDate;    }    //获得当前日期与本周日相差的天数    private static int getMondayPlus() {        Calendar cd Calendar.getInstance();        // 获得今天是一周的第几天星期日是第一天星期二是第二天......        int dayOfWeek cd.get(Calendar.DAY_OF_WEEK) - 1; // 因为按中国礼拜一作为第一天所以这里减1        if (dayOfWeek 1) {            return 0;        } else {            return dayOfWeek - 1;        }    }    //获得本周一的日期    public static String getThisMondayDate() {        Calendar cal Calendar.getInstance();        int mondayPlus getMondayPlus();        cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)-mondayPlus);        cal.set(Calendar.HOUR_OF_DAY, 0);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        return getDate(cal);    }        //获得本月1号的日期    public static String getCurrentMonthBeginDate(){        Calendar cal Calendar.getInstance();        cal.set(Calendar.DAY_OF_MONTH, 1);        cal.set(Calendar.HOUR_OF_DAY, 0);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        return getDate(cal);    }        //获得上周一的日期    public static String getLastMondayDate(){        Calendar cal Calendar.getInstance();        int dayPlus getMondayPlus()7;        cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)-dayPlus);        cal.set(Calendar.HOUR_OF_DAY, 0);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        return getDate(cal);    }        //获得上周日的日期    public static String getLastSundayDate(){        Calendar cal Calendar.getInstance();        int dayPlus getMondayPlus()1;        cal.set(Calendar.DAY_OF_MONTH, cal.get(Calendar.DAY_OF_MONTH)-dayPlus);        cal.set(Calendar.HOUR_OF_DAY, 23);        cal.set(Calendar.MINUTE, 59);        cal.set(Calendar.SECOND, 59);        return getDate(cal);    }        //获得上月1号的日期    public static String getLastMonthBeginDate(){        Calendar cal Calendar.getInstance();        cal.set(Calendar.MONTH, cal.get(Calendar.MONTH)-1);        cal.set(Calendar.DAY_OF_MONTH,1);        cal.set(Calendar.HOUR_OF_DAY, 0);        cal.set(Calendar.MINUTE, 0);        cal.set(Calendar.SECOND, 0);        return getDate(cal);    }        //获得上个月最后一天的日期    public static String getLastMonthEndDate(){        Calendar cal Calendar.getInstance();        cal.set(Calendar.DAY_OF_MONTH, 0);        cal.set(Calendar.HOUR_OF_DAY, 23);        cal.set(Calendar.MINUTE, 59);        cal.set(Calendar.SECOND, 59);        return getDate(cal);    }    public static void main(String[] args) {        System.out.println(getDate());        System.out.println(getThisMondayDate());        System.out.println(getCurrentMonthBeginDate());        System.out.println(getLastMondayDate());        System.out.println(getLastSundayDate());        System.out.println(getLastMonthBeginDate());        System.out.println(getLastMonthEndDate());    } 转载于:https://www.cnblogs.com/isoftware/p/3921827.html
http://www.pierceye.com/news/943516/

相关文章:

  • 厦门同安网站建设视频购物网站开发方案
  • 什么是建设网站的主题兼职做问卷调查的网站
  • 装饰网站建设软件下载公司旅游视频网站模板免费下载
  • aws网站建设个体户做网站去哪里做
  • 用四字成语做网站域名好吗宁波网站推广专业服务
  • 深圳网站建设公司是网络推广网上营销
  • 网站视频站建设教程和仿qq商城版淘宝客网站源码模板+带程序后台文章dede织梦企业程序
  • 温州红酒网站建设长沙移动网站建设
  • 如何制作网站?企业网站制作步骤
  • 桓台县旅游网站建设购物网站建设技术难点
  • 单页网站推广网站qq链接怎么做
  • wordpress仿站步骤平乡网站建设
  • 青岛高端网站建设公司新网站seo技术
  • 手机网站后台甘肃网络推广技巧
  • 做co网站阿里云建站方案
  • 如何做网站首页优化怎么查网站点击量
  • 北京网站制作百度推广潜江资讯网二手房出售
  • 北京建网站软件深圳企业网站
  • 网站关键词互点备案网站简介怎么写
  • 网站建设报告书范文哈尔滨网站公司哪家好
  • 景观毕业设计作品网站公司网站销售平台建设费分录
  • 品牌网站建设还来大蝌蚪华为手机WordPress
  • 东莞制作企业网站公司网站营销活动页面制作
  • 有中文网站 怎么做英文网站企业网站建设 价格
  • 网络游戏网站开发建设工程施工合同样本
  • 陕西网站制作公司泸州中泸集团建设有限公司网站
  • 营销型网站建设的概念电子商务公司最低注册资本
  • 计划书网站推广的目录怎么做太原便宜做网站的公司哪家好
  • wordpress 直播插件麒麟seo外推软件
  • 网站检测报告哪里做寰宇seo