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

什么样的网站高大上seo排名优化资源

什么样的网站高大上,seo排名优化资源,Wordpress 悬浮菜单,网络安全公司有哪些效果 最近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年:202…

效果

  1. 最近7天:2024年6月21日-2024年6月27日
  2. 过去一周、最近一周:2024年6月16日-2024年6月22日
  3. 过去三个月:2024年3月-2024年6月
  4. 近半年、过去半年:2023年12月-2024年6月
  5. 去年:2023年1月-2023年12月
  6. 过去3年:2021年1月-2024年12月
  7. 累计: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-'W'ww"));}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/710989/

相关文章:

  • 12380网站建设情况总结百度浏览器入口
  • 直播网站开发要多久排行榜前十名
  • 网站备案完才能建站吗企业建站公司
  • 网站开发外包合同西安网站优化公司
  • 2022网页设计尺寸规范和要求怎么做seo关键词优化
  • 北京大学两学一做网站十大收益最好的自媒体平台
  • 网站开发服务费企业网站建设的一般要素
  • 台州企业网站制作公司郴州网站推广
  • 如何做移动端网站邮件营销
  • 网站制作佛山crm管理系统
  • 网站综合营销方案设计网页设计教程
  • 东莞做网站制作宁波技术好的企业网站制作
  • 广州做网站公司哪家好如何注册一个网站
  • 网站备案协议书互联网营销师证书含金量
  • 广州企业网站建设报价免费推广网站大全
  • 宁波网站排名怎么提交网址让百度收录
  • 杭州 手机网站建设活动营销
  • 加网络网站建设工作室做一个企业网站大概需要多少钱
  • 张家港优化网站seo百度网盘下载
  • 烟台有没有做网站网站安全
  • 网站建设与制作设计公司惠州seo代理商
  • 东营新闻网今日头条常州网站seo
  • 东莞全网合一网站黄页引流推广网站软件免费
  • wordpress的数据库在那里百度seo如何快速排名
  • wordpress手机客服代码免费seo快速排名工具
  • web网站开发作品关键词歌词图片
  • 汕头行业网站seo培训公司
  • 网站背景图片优化关键词歌曲免费听
  • 郑州做网站哪家专业我要发布信息
  • 西安做网站优化的公司石家庄seo按天扣费