From the course: Visual Basic Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Work with dates and times - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Work with dates and times
- [Instructor] I've previously described how to work with numbers and strings, and now I'll move to the third most popular data type, dates. In Visual Basic, a date value contains both the date and the time, and there are a variety of ways of creating date variables. We'll look at three ways to set date and time values, with a literal, with parse, and by getting the current system clock information. To declare a variable, you start, like any other variable, with the dim keyword. And then here, instead of using a string value to set the literal date, I will use the date delimiters, which is the pound symbol or the number sign. Now I can put in the value I want, and it will take this literal value and put it in this literal date. You can also use date.parse, like this. Now I can put a string value in here, like that. And then it'll attempt to parse that value, if it looks like a valid date. Another way to do this is to work…
Contents
-
-
-
-
-
-
-
-
-
Work with variables and constants4m 56s
-
(Locked)
Use the Code Explorer project1m 59s
-
(Locked)
Declare a variable6m 30s
-
(Locked)
Tips to make literals pop in the editor2m 34s
-
(Locked)
Work with custom and built-in constants3m 54s
-
(Locked)
Understand variable scope5m 42s
-
(Locked)
Understand numeric to numeric conversions5m 54s
-
(Locked)
Convert numeric values5m 43s
-
(Locked)
Convert and format numbers to string6m 39s
-
(Locked)
Convert and parse string to numbers5m 59s
-
(Locked)
Work with strings7m 11s
-
(Locked)
Work with dates and times9m 21s
-
(Locked)
Challenge: Strings, dates, and parsing52s
-
(Locked)
Solution: Strings, dates, and parsing2m 5s
-
-
-
-
-
-
-
-