如何在vb.net中获取两个日期之间的日期

编程入门 行业动态 更新时间:2024-10-26 02:34:27
本文介绍了如何在vb中获取两个日期之间的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在vb中获取两个日期之间的日期名称. 前-Fromdate(2012年7月16日) 至今(7/22/2012) 输出 2012年7月16日 2012年7月17日 2012年7月18日 2012年7月19日 2012年7月20日 2012年7月21日 2012年7月22日 就是这样.. 我需要将这些日期分配到文本框中... 在此先感谢 Sucharitha

Hi, How to get the days names between two dates in vb. Ex- Fromdate(7/16/2012) Todate(7/22/2012) OutPut 7/16/2012 7/17/2012 7/18/2012 7/19/2012 7/20/2012 7/21/2012 7/22/2012 Like that.. I need to assign those dates into textboxes... Thanks in advance Sucharitha

推荐答案

尝试一下: Try this: Dim startDay As Date Dim endDay As Date startDay = New Date(2012, 7, 16) endDay = New Date(2012, 7, 22) Dim dayCtr As Date dayCtr = startDay Do While (dayCtr <= endDay) MessageBox.Show(dayCtr.Date.Day & "-" & dayCtr.Date.DayOfWeek.ToString()) dayCtr = dayCtr.AddDays(1) Loop

任何人都可以给我代码 不,它在这里不能这样工作. 这是询问者的期望: 1. 先尝试您要做什么!您可能会发现它并不难. 2.制定看起来像问题/无法解决的问题. 试试看,告诉他们是否遇到问题. 成员将很乐意为您提供帮助. 阅读有关:DateTime结构公开的DayofWeek属性. 参考: DateTime.DayOfWeek属性 [ ^ ] MSDN:DateTime结构 [ ^ ] Please can any body give me the code No. It does not work like this here. Here is what is expected of enquirers: 1. TRY first what you want to do! You may find that it''s not that hard. 2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues. Members will be more than happy to help like this. Read about: DayofWeek property exposed by DateTime structure. Refer: DateTime.DayOfWeek Property[^] MSDN: DateTime Structure[^]

请可以使用任何正文给我代码 不,它在这里不能这样工作. 这是询问者的期望: 1. 先尝试您要做什么!您可能会发现它并不难. 2.制定看起来像问题/无法解决的问题. 试试看,告诉他们是否遇到问题. 成员将很乐意为您提供帮助. 阅读有关:DateTime结构公开的DayOfWeek属性. 参考: DateTime.DayOfWeek属性 [ ^ ] MSDN:DateTime结构 [ ^ ] Please can any body give me the code No. It does not work like this here. Here is what is expected of enquirers: 1. TRY first what you want to do! You may find that it''s not that hard. 2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues. Members will be more than happy to help like this. Read about: DayOfWeek property exposed by DateTime structure. Refer: DateTime.DayOfWeek Property[^] MSDN: DateTime Structure[^]

更多推荐

如何在vb.net中获取两个日期之间的日期

本文发布于:2023-10-25 18:31:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1527749.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日期   两个   如何在   net   vb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!