From the course: Learning Julia

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Dates and times

Dates and times - Julia Tutorial

From the course: Learning Julia

Start my 1-month free trial

Dates and times

- [Instructor] Julia also provides a module for working with date and time information which is what we will learn about in this example. So I'll go ahead and open up the datetime_start in my editor. And you can see that I've imported the Dates module with the using dates statement here and that gives me access to the Date and DateTime classes. So let's start with something simple. I'm going to define two variables that represent a Date and a DateTime combination. So for the first one I'll have d1 and that's going to be a Date so I'll specify the year, month and day. And then I'll have dt1 and I'll create a DateTime and that's also going to have a year, month and day and I'm going to leave the time information out and then I'll just print these out to the output. (keyboard clacking) So, there's that and then we'll have the carriage return and dt1. Okay, so let's go ahead and try running that. So let's switch over to the terminal and all right so there you can see the Date output right…

Contents