查询时间段内所有日期(限foton)

博客展示了在Foton中查询时间段内所有日期的代码。通过给定日期字符串,解析为日期对象,获取该月的开始和结束时间,利用迭代器遍历每日时间段,并打印出每日的开始和结束时间,若解析出错则打印异常信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

String dataStr = "2019-04";
try {
Date date = DateUtils.parseDate(dataStr);
Date startTime = DateUtils.getStartTime(DateUtils.DateType.MONTHLY, date, null);
Date endTime = DateUtils.getEndTime(DateUtils.DateType.MONTHLY, date);
Pair<Date , Date> pair = null;
Iterator<Pair<Date , Date>> iterator = DateUtils.getIterator(startTime, endTime, DateType.DAILY, false);
while(iterator.hasNext()){
pair = iterator.next();
System.out.println("startTime:" + DateUtils.toString(pair.getKey(),DateUtils.DEFAULT_DATE_TIME_FORMAT) + "____endTime:" + DateUtils.toString(pair.getValue(),DateUtils.DEFAULT_DATE_TIME_FORMAT));
}
} catch (ParseException e) {
e.printStackTrace();
}

  

转载于:https://www.cnblogs.com/charkey/p/10953253.html

CMake Error at /usr/local/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: '/home/yanghuan/code/foton_mcu_app/build/CMakeFiles/CMakeScratch/TryCompile-bfcsBN' Run Build Command(s): /usr/bin/ninja -v cmTC_b1c02 [1/2] /usr/bin/cc -mcpu=cortex-m33 -o CMakeFiles/cmTC_b1c02.dir/testCCompiler.c.o -c /home/yanghuan/code/foton_mcu_app/build/CMakeFiles/CMakeScratch/TryCompile-bfcsBN/testCCompiler.c FAILED: CMakeFiles/cmTC_b1c02.dir/testCCompiler.c.o /usr/bin/cc -mcpu=cortex-m33 -o CMakeFiles/cmTC_b1c02.dir/testCCompiler.c.o -c /home/yanghuan/code/foton_mcu_app/build/CMakeFiles/CMakeScratch/TryCompile-bfcsBN/testCCompiler.c cc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead cc1: error: bad value ('cortex-m33') for '-mtune=' switch cc1: note: valid arguments to '-mtune=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 generic ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:6 (project)
最新发布
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值