 Our clock is running pretty well, but let's say we wanted to customize it a little bit. Let's say we wanted to move it to a 12 hour clock and show an AM or a PM after it. We can get at all of this going back to our time package and there are a couple of really helpful functions here. The first of these is local time. This is like pulling time, but it makes sure that it converts it to the local time zone. There is a really cool function called strf time or string format time, which takes a time structure which we'll come back to in a second. You're not expected to know what that is yet. It takes a time structure and then based on some pattern that we provide, it spits out the results. This actually describes its own little tiny language for formatting time. It gives all these different pieces that you can use that you can pull out. We can pull out the hour of the 24 hour clock with a percent capital H or the hour of a 12 hour clock with a percent capital I. We can get months, days, minutes, seconds. We can get the weekday either spelled out or as a number or as a three letter abbreviation. We can get the time zone. All of these little bits and pieces we can pull out and here's an example of how they fit together. This looks a whole lot like the C time function output that we were getting before. This shows how to put it together. You can feed it a time. In this case, GM time is how they get that. Here is a string, percent A comma space, percent D space, percent B. We can go back up and see what these correspond to. And A, the locales abbreviated weekday name. This will take into account where you are locally and also what your local language is and use all this to get the weekday name abbreviated. In this case, it's an English-speaking country and it's Thursday, so the abbreviated weekday is T-H-U. We can look at percent D, which is the day of the month as a decimal number. And notice that it's formatted from 01 to 31, so it will always be two digits. So that's super helpful. We can see here how the time is formatted. So percent H colon percent M colon percent S. We look those up. Percent H is the 24-hour number. Percent M is the minute as a two-digit minute number. And percent S is the second as a two-digit decimal number. When you put it all together, you can see how each of these pieces of information being slotted into this string spliced together gives the full day of the week, day of the month, month, year, hour, minute, second. And then this plus 000 is something that just it is added explicitly here in this string. So very, very cool. So this is helpful. We can use this to get any format we want. And we can by using a percent I, percent M, percent S, and a percent P, we can get AMPM or whatever the equivalent is in the local location. At the very beginning here, it calls out that STRF time will take both the format and a time, either GM time or local time. So GM time is the time at GMT, Greenwich Mean Time. So it's the kind of global baseline time zone. Most of us don't live in that. And so it's convenient to get the local time because that's really the one we care about. Unless your appointment's in London or somewhere in that time zone, the local time is a good place to start. When we put this together, we can use this local time function to get our time structure. And we pass that together with our string format, which gives us 12 hour, hour, minute, second, AMPM, create a string, print it with the carriage return, sleep for a second, and then do it all over again. Then when we run it, we can see the result is exactly what we had hoped it would be. 12 hour, hour, minute, second, and AMPM in the local time zone. A couple of things about this. This is at a much more detailed level than anyone should ever be expected to remember. The whole list of percent codes that we can use to format our date and time, that's there in the documentation so you can look it up, so you don't have to remember it. And yeah, if you use the same thing a dozen times a day, it'll stick in your brain after a while. But my advice is don't worry about memorizing that stuff. Look it up when you need it. Another thing to keep in mind is that time zones are tricky. Working with dates and times are tricky. There's a whole lot of caveats and there's local spins on things. There are time zones that are not on the even hour depending on where you are. The names of months and days of week changes no matter where you are. All of these things, the time package takes care of for you. You can if you enjoy the exercise, by all means go and write some time functions. I've done this, I've written some custom date code. Without fail, it is long and messy and has errors in it. But it's super interesting to think through the issues there. When I ever need anything that matters, I use the time package. Because so many people have worked on it for so long and thought through it so carefully that they've worked out all those little kinks. And now I can use it without thinking twice about it and all those things are taken care of. In general, that's a great rule of thumb. Build something from scratch if you want to. Often there is a tool or a package ready to go for you to import and use. And that's a fantastic way to expand your programming capability very quickly.