In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to combine the time value of VB.NET, I hope you will gain something after reading this article, let's discuss it together!
VB.NET combined time value
There are several ways to get VB.NET to combine time values. Listing A shows several ways to achieve the same function.
The ◆ * message box will display: dtDate1: 1 * message box will display:
The second message box of the ◆ will display: dtDate2: 1 Universe 2 ◆ 12:00:00 A.M.
The third message box of ◆ will show: dtDate3: 2 * 3 *
The fourth message box of the ◆ will display: dtDate4: 2 * 3 *
An example of VB.NET combined time value
To set the value of the variable dtDate1, ◆, I use the # symbol to set the date to 1 move 2 pm 2007. Since no time is specified, the system assigns the time to 12:00:00 A.M. By default. (if you specify # 1 PM#, 2 PM#, at 3:59:00, the specified time is 3:59:00 P.M. )
◆ sets the value of the variable dtDate2, and I use the Date object to submit it to the same date value as dtDate1. The result is the same; the date displayed by dtDate1 is exactly the same as the date of dtDate2. Because I saved the time, the system defaults to 12:00:00 A.M.
◆ sets the value of the variable dtDate3, and I provide complete information, including time. Notice that I use military time and set it to 3:00:00 A.M.
◆ sets the value of the variable dtDate4. I use the same date and time as dtDate3, but its time is set to 15:00:00, resulting in 3:00:00 P.M.
Private Sub DateTimeCombination () Dim dtDate1 As Date = # 1Accord 200 Dim dtDate2 As New Date (2007, 1, 2) Dim dtDate3 As New Date (2007, 2, 3, 1, 59) Dim dtDate4 As New Date (2007, 2, 3, 15, 1) 59) MsgBox ("dtDate1:" & dtDate1.ToString ()) MsgBox ("dtDate2:" & dtDate2.ToString ()) MsgBox ("dtDate3:" & dtDate3.ToString ()) MsgBox ("dtDate4:" & dtDate4.ToString ()) End Sub has finished reading this article I believe you have a certain understanding of "how VB.NET combines time values". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.