| public static void main(String[] args) { |
| |
| |
| ChineseDate chineseDate = new ChineseDate(2022, 12, 10); |
| |
| ChineseDate chineseDate1 = new ChineseDate(DateUtil.parse("2023-01-01")); |
| |
| int chineseYear = chineseDate.getChineseYear(); |
| int chineseYear1 = chineseDate1.getChineseYear(); |
| String cyclical = chineseDate.getCyclical(); |
| String cyclical1 = chineseDate1.getCyclical(); |
| |
| String cyclicalYMD = chineseDate.getCyclicalYMD(); |
| String cyclicalYMD1 = chineseDate1.getCyclicalYMD(); |
| log.info("农历构建:" + chineseYear + "年"); |
| log.info("公历构建:" + chineseYear1 + "年"); |
| log.info("农历构建:" + cyclical); |
| log.info("农历构建:" + cyclicalYMD); |
| log.info("公历构建:" + cyclical1); |
| log.info("公历构建:" + cyclicalYMD1); |
| |
| String chineseMonth = chineseDate.getChineseMonth(); |
| String chineseMonth1 = chineseDate1.getChineseMonth(); |
| log.info("农历构建:" + chineseMonth); |
| log.info("公历构建:" + chineseMonth1); |
| String chineseMonthName = chineseDate.getChineseMonthName(); |
| String chineseMonthName1 = chineseDate1.getChineseMonthName(); |
| log.info("农历构建:" + chineseMonthName); |
| log.info("公历构建:" + chineseMonthName1); |
| |
| String chineseDay = chineseDate.getChineseDay(); |
| log.info(chineseDay); |
| |
| int gregorianDay = chineseDate.getGregorianDay(); |
| log.info(gregorianDay + "号"); |
| |
| String chineseDay1 = chineseDate1.getChineseDay(); |
| log.info(chineseDay1); |
| |
| int gregorianDay1 = chineseDate1.getGregorianDay(); |
| log.info(gregorianDay1 + "号"); |
| |
| |
| String zodiac = chineseDate.getChineseZodiac(); |
| String zodiac1 = chineseDate1.getChineseZodiac(); |
| log.info("农历构建:" + zodiac); |
| log.info("公历构建:" + zodiac1); |
| |
| |
| String festivals = chineseDate.getFestivals(); |
| String festivals1 = chineseDate1.getFestivals(); |
| |
| log.info(festivals); |
| log.info(festivals1); |
| |
| |
| DateTime dateTime = DateUtil.parse("2023年1月21日"); |
| ChineseDate chineseDate2 = new ChineseDate(dateTime); |
| String festivals2 = chineseDate2.getFestivals(); |
| |
| log.info(festivals2); |
| |
| |
| String festivals3 = new ChineseDate(DateUtil.parse("2023年1月22日")).getFestivals(); |
| log.info(festivals3); |
| |
| String festivals4 = new ChineseDate(DateUtil.parse("2023年1月23日")).getFestivals(); |
| log.info(festivals4); |
| |
| String festivals5 = new ChineseDate(DateUtil.parse("2023年1月24日")).getFestivals(); |
| log.info(festivals5); |
| |
| |
| log.info(chineseDate.toString()); |
| |
| log.info(chineseDate1.toString()); |
| |
| log.info(chineseDate2.toString()); |
| |
| } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix