Welcome to Intermediate Visual Basic, this is the third course in the Introduction to Computer Programming and Visual Basic Specialization. In this first module of the course, we're going to build up our skills and more in programming by introducing dates and times. And also some more advanced string operation. So we've seen strings in a previous course, and you've done a little bit with strings, but I want you to have a larger tool set of how you can manage strings. And we won't cover everything, there's many ways you can manipulate strings in programming, we do it a lot. But your skill set will be greater here, and we'll keep building on it as we move forward in these courses, all right? So let's have some fun, so some learning objectives for this module. You should be able to, when we're done with this module, develop computer programs that utilize the string operations in the execution of programs. You should also be able to develop computer programs that utilize date and time data types in the execution of programs. You should be able to develop computer programs that format different numbers. And you should be able to develop computer programs that format dates and times, okay? All right, so in this first lesson, let's look at date time values. So there are three ways that you can declare a variable of either Date or DateTime. Number one in front of you, we're using the dim statement we used before to declare a variable. We give it a variable name and we say either as Date or as DateTime, those are two different data types. And we can assign it a date literal separated with the pound symbol, okay and we'll see the next couple of slides, some examples of date literals. The second way here is you can declare variable as a Date or a DateTime and use the DateTime, Parse. So you've got a date embedded in a string and you can pull out that date portion, okay? And the third way here is we can build up a new DateTime based on the component, the year, month, day, hour, minute, second and millisecond, okay? All right, so when we think about literals, there are many ways to write date literals, okay? And it's different in different parts of the world, so you have to be very careful. So, the first couple here show you in a month-day-year format, either with slash or a dash. And then the third one has a year -month-day, and the fourth one year-month-day, either with leading zeros or not using a slash. The fifth one is the one I recommend you use, which is year year year-month month-day day. So in reverse order, that's sort of the universal way in programming that we represent literal dates, right? So visual basic allows all these other ones, but it tends to lead to bugs, right, so I recommend you always go year year year-month month-date date. We also have time literal formats, and there's several ways, you can represent with the hour:minute minute and then either AM or PM. Or the second one, which is my recommendation is you're using 24-hour clock, so 24 hour:minute, minute, and you could do colon second if you want. Or you could represent with, hours, minutes, seconds and AM and PM, right, the middle ones, the more universal one. All right, we can also retrieve the date and time from the computer clock. So here you see, we declare a date, and we're getting it from DateTime, now will retrieve the date of the computer, including the time. The second one here we see DateTime, today that includes the computer clock's date without the time. But it's actually a time which is essentially midnight, where that day starts, it's a little strange, so in computers we think of midnight as the beginning of the day. I think of it as a nighttime in my brain, but in computers 12AM is midnight and we go to 11:59:59PM is the end of the day something to get used to. All right, we also have some standard formatting methods. So if we've got a datetime value, we can use these four different methods to display the date and time in some standard formats. And I encourage you to just write some code and try these out so you can see them. So too long date string is going to take the daytime value and change it to a string that's include the name of the day of the week. The name of the month, the day of the month and the year, the two short date strings going to convert the daytime value to a string. That's going to include the numbers for the month, day, year, the too long time strings going to convert the date time to a string that includes the hours, minutes and seconds. And the too short time strings going to convert the date time to a string that includes hours and minutes and 24 hour time. We also have many properties on a daytime object so we can pull out the components. The month, the day, the year, the hour, the minute the second, the time of the day, the day of the week, the day of the year. So we can work with those components individuals, and we have a couple methods here for working with daytime die so we can say how many days or in a month right. It's not always the same with leap years, sometimes February, for example, has 29 days, sometimes has 28, so we pass it in a specific year and a month. It takes two parameters there, we can also test if a year is a leap year with the is Leap year method. And we have some methods to manipulate dates and times so we can add days or add months or add years or hours, minutes, seconds or a time span. Or we could also subtract, and when I say add, it could be a negative value, okay, so let's look at some example code here. So the first one, we're just setting the variable this daytime to the clock's time, dating time with now function the second one. We're getting the month in a year from the component the dot month property, the third one. We're getting the hour from the dot our property, the fourth one, we're getting the day of the year as an injure. The fifth one, we're pulling out how many days in a specific month. So we're looking at February 2021 which is the month I'm recording this in to see how many days I want to know when that snow is going to go away. The 61 I'm testing to see if this year is a leap here, okay, that's going to return a Boolean. And the seventh one, I'm using the too long date string function, and I'm just printing it out. Remember, I encourage you to try those four different string functions to play with them a little bit, and then the eighth one here, we're just manipulating the date. So I've got a variable this date time, and I'm going to add seven days to it, okay? And then I'm going to sign that to the variable next week, state. All right, so just a little review of this lesson, date time values have properties to achieve the different component parts. That makes it very handy, there are methods on Dayton daytime objects to manipulate values. And there are methods on date time values to convert them to straits, all right, I'll see in the next lesson