9
196
1673
金牌会员
bugensui 发表于 2023-3-16 11:25 为什么要把day除以100.直接以月份判断春夏秋冬,不是一样的吗,day有什么参考价值呢, ...
使用道具 举报
170
2543
8473
元老级技术达人
tangyali 发表于 2023-3-16 19:51 因为季节这样的: 2月4日-5月4日为春季 5月5日-8月7日为夏季
#3-5春季6-9夏季10-11秋季12-2冬季 jijie: friendly_name: "季节" icon_template: mdi:weather-windy value_template: "{% if now().month >2 and now().month < 6 %}春{% elif now().month >5 and now().month < 10 %}夏{% elif now().month >9 and now().month < 12 %}秋{% else %}冬{% endif %}"
bugensui 发表于 2023-3-17 11:11 原来如此,我直接通过月份判断的,
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-5-13 16:52 , Processed in 0.318768 second(s), 22 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.