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

做本地生活圈网站好吗数据分析网站怎么做

做本地生活圈网站好吗,数据分析网站怎么做,网站开发用什么软件开发,网站建设与管理培训总结效果 最近7天#xff1a;2024年6月21日-2024年6月27日过去一周、最近一周#xff1a;2024年6月16日-2024年6月22日过去三个月#xff1a;2024年3月-2024年6月近半年、过去半年#xff1a;2023年12月-2024年6月去年#xff1a;2023年1月-2023年12月过去3年#xff1a;202…效果 最近7天2024年6月21日-2024年6月27日过去一周、最近一周2024年6月16日-2024年6月22日过去三个月2024年3月-2024年6月近半年、过去半年2023年12月-2024年6月去年2023年1月-2023年12月过去3年2021年1月-2024年12月累计2020年1月1日-2024年6月27日 代码 import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.temporal.WeekFields; import java.util.Locale;public class DataFormatUtil {public static String getDates(String timeType) {LocalDate now LocalDate.now();if (日.equals(timeType)) {// 格式化为 YYYY-MM-DDreturn now.format(DateTimeFormatter.ofPattern(yyyy-MM-dd));}if (周.equals(timeType)) {// 格式化为 YYYY-WX// 周数W是按照ISO 8601标准每周从周一开始每年的第一周至少包含4天return now.format(DateTimeFormatter.ofPattern(yyyy-Www));}if (月.equals(timeType)) {// 格式化为 YYYY-MMreturn now.format(DateTimeFormatter.ofPattern(yyyy-MM));}if (季.equals(timeType)) {// 格式化为 YYYY-QX// 季度Q是按照每个季度三个月计算1-3月为第一季度4-6月为第二季度依此类推String quarter String.valueOf((now.getMonthValue() - 1) / 3 1);return now.format(DateTimeFormatter.ofPattern(yyyy)) -Q quarter;}if (年.equals(timeType)) {// 格式化为 YYYYreturn now.format(DateTimeFormatter.ofPattern(yyyy));}return 未知时间颗粒度;}/*** 处理特殊时间** return 结果*/public static String getAllTimeRanges() {// 获取当前时间并格式化为字符串LocalDate now LocalDate.now();DateTimeFormatter formatter DateTimeFormatter.ofPattern(yyyyMMdd);String currentDateString now.format(formatter);LocalDate currentDate LocalDate.parse(currentDateString, DateTimeFormatter.BASIC_ISO_DATE);LocalDate startDate;String[] timeRanges new String[8];// 最近7天startDate currentDate.minusDays(6);timeRanges[0] String.format(最近7天%d年%d月%d日-%d年%d月%d日,startDate.getYear(), startDate.getMonthValue(), startDate.getDayOfMonth(),currentDate.getYear(), currentDate.getMonthValue(), currentDate.getDayOfMonth());// 过去一周、最近一周startDate currentDate.with(WeekFields.of(Locale.getDefault()).dayOfWeek(), 1).minusWeeks(1);LocalDate endDate startDate.plusDays(6);timeRanges[1] String.format(过去一周、最近一周%d年%d月%d日-%d年%d月%d日,startDate.getYear(), startDate.getMonthValue(), startDate.getDayOfMonth(),endDate.getYear(), endDate.getMonthValue(), endDate.getDayOfMonth());// 过去三个月startDate currentDate.minusMonths(3);timeRanges[2] String.format(过去三个月%d年%d月-%d年%d月,startDate.getYear(), startDate.getMonthValue(),currentDate.getYear(), currentDate.getMonthValue());// 近半年、过去半年startDate currentDate.minusMonths(6);timeRanges[3] String.format(近半年、过去半年%d年%d月-%d年%d月,startDate.getYear(), startDate.getMonthValue(),currentDate.getYear(), currentDate.getMonthValue());// 去年startDate currentDate.minusYears(1).withMonth(1).withDayOfMonth(1);endDate startDate.plusYears(1).minusDays(1);timeRanges[4] String.format(去年%d年1月-%d年12月,startDate.getYear(), startDate.getYear());// 过去3年startDate currentDate.minusYears(3);timeRanges[5] String.format(过去3年%d年1月-%d年12月,startDate.getYear(), currentDate.getYear());// 累计这里假设项目开始日期为2020年1月1日startDate LocalDate.of(2020, 1, 1);timeRanges[6] String.format(累计%d年1月1日-%d年%d月%d日,startDate.getYear(), currentDate.getYear(), currentDate.getMonthValue(), currentDate.getDayOfMonth());// 为了简化这里我们忽略近XX月、近XX年的情况因为它们与过去XX月、过去XX年的处理相同StringBuilder result new StringBuilder();for (int i 0; i timeRanges.length - 1; i) {result.append(i 1).append(. ).append(timeRanges[i]).append(\n);}return result.toString();} }
http://www.hkea.cn/news/14426159/

相关文章:

  • 教育课程网站建设公司手机网站开发
  • 新网站怎么运营wordpress作者英文版
  • app网站制作公司wordpress微博头条
  • 杭州建德网站建设响应式网页设计实例
  • 万户做网站怎么样做网站投诉要钱吗
  • 做的好看的网站上传文章的网站
  • 南昌网站建设机构怎么劝客户做网站
  • 网站seo诊断分析报告wordpress特定主题
  • 暖色网站模板wordpress破解key
  • 网站建设毕业设计 任务书做网站的公司找客户
  • 网站开发和数据库的关系陈木胜妻子
  • 网站 报价单西安旅游攻略ppt
  • 番禺区营销型网站建设nas有域名了怎么做网站
  • 新建网站做优化个人网站设计论文前言
  • 盗网站asp源码手机h5是什么意思
  • 网站 linux 服务器中国对外贸易网
  • 网站已经开发怎样用微信实现手机网站开发沈阳做网站怎样收费
  • 网站建设龙华网站论坛怎样建设
  • 响应式网站建设多少钱网站网站建设设计公司
  • 广州网站建设专注乐云seo广州seo顾问
  • 做新的网站深圳百姓网
  • 投诉做单骗子网站公司企业做网站
  • 广西建设厅网站首页西安网站开发制作
  • 上海做兼职网站有吗哪个网站做非洲的生意
  • 湛江网站制作公司wordpress 鼠标跟随
  • 东莞网站制作个性化成都市成华区建设路商务中心网站
  • 门户网站作用长安公司网站设计
  • 让网站会员做产品标签确认西安seo阳建
  • api网站制作专业做网站建设
  • 昆明学网站建设企业软件定制开发包括