程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了从熊猫日期范围功能中删除时间大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决从熊猫日期范围功能中删除时间?

开发过程中遇到从熊猫日期范围功能中删除时间的问题如何解决?下面主要结合日常开发的经验,给出你关于从熊猫日期范围功能中删除时间的解决方法建议,希望对你解决从熊猫日期范围功能中删除时间有所启发或帮助;

我使用熊猫测距仪计算了一个日期范围:

@H_465_5@max_date_column = ws.max_column
last_date_entered = ws.cell(row=1,column=max_date_column).value
todays_date = datetiR_563_11845@e.date.today()
Date_difference = pd.date_range(start= last_date_entered,end=todays_date,freq='D')
print("last date entered was ")
print(last_date_entered)
print("todays date is ")
print(todays_datE)
print("the days not done are")
print(Date_differencE)
for date in Date_difference:
 print(datE)

它给我的打印结果如下图所示。 我的问题是,当我将其放入 HTML 时,它包含时间。我不想要时间,我只想要约会。我怎样才能摆脱时间?

我通过以下方式将其输入到我的 HTML 中:

{% for date in Date_difference %}
<h5>{{ date }}</h5>
{% endfor %}

当我这样做时,它会在屏幕上显示以下内容:

Jan. 28,2021,mIDnight
Jan. 29,mIDnight
Jan. 30,mIDnight
Jan. 31,mIDnight
Feb. 1,mIDnight
Feb. 2,mIDnight
Feb. 3,mIDnight
Feb. 4,mIDnight
Feb. 5,mIDnight 

从熊猫日期范围功能中删除时间

解决方法

使用 datetiR_563_11845@e.datetiR_563_11845@e.now().date() 方法。

打印(日期.日期())

大佬总结

以上是大佬教程为你收集整理的从熊猫日期范围功能中删除时间全部内容,希望文章能够帮你解决从熊猫日期范围功能中删除时间所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: