如何查找当月的最后日期? [英] How to find the last date of the month?

查看:57
本文介绍了如何查找当月的最后日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找当月的最后日期?

How to find the last date of the month?

推荐答案

Google It [ ] [ ^ ]


是指给定日期的月份,还是指定日期的最后日期一个月?



给定日期的月份只是

Do you mean the month of a given date, or the last date of the month?

Month of a given date is just
DateTime myDate = DateTime.Today;
string myMonth = myDate.Month;





如果你意味着本月的最后一个日期,已经讨论过这里



LG



If you meant last date of the month, this has been discussed Here

LG


试试这个:

Try this:
SELECT DATEADD(day, -1, DATEADD(month, DATEDIFF(month, 0, getdate()) + 1, 0))


这篇关于如何查找当月的最后日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆