Date() function in Julia with Examples Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Date() function in Julia works like a Constructors. The date can be constructed by Period types or integer by parsing the given period and integer. By default, it returns 0001-01-01. The first four digits represent the year, the next two digits represent the month and last two digits represent the day. Syntax: Date(YYYY-MM-DD) or Date(Dates.Year(YYYY), Dates.Month(MM), Dates.Day(DD)) where, YYYY-4 digit integer MM-2 digit integer DD-2 digit integer Returns: A date of fixed format. Below examples illustrate the use of above function: Example 1: Python3 # Date function in julia date = Date(Dates.Year(2019), Dates.Month(01), Dates.Day(26)) # Printing the date println(date) Output: 2019-01-26 In the above code, all the parameters are passed to the Date() function and it returns a date format. Example 2: Python3 # Date function in julia date = Date(2020, 07, 7) # Printing the date println(date) Output: 2020-07-07 In this example, all the parameters are passed in a comma separated format and it returns date in specific default format. Example 3: Python3 # Date function in julia date = Date(2020, 07) # Printing the date println(date) Output: 2020-07-01 In the above code, only two of the parameter(YYYY, MM) is passed in comma separated format and it returns a date format with the default day 01. Example 4: Python3 # Date function in julia date = Date() # Printing the date println(date) Output: 0001-01-01 In this example, no parameter(YYYY, MM) is passed and it returns a date format with the default date 0001-01-01. Comment More infoAdvertise with us Next Article Expressions and Macros in Julia A avengerjanus123 Follow Improve Article Tags : Julia julia-basic-methods Similar Reads Julia | checkindex() function with examples The checkindex() is an inbuilt function in julia which is used to return true if the given index value lies within the range, otherwise returns false. Syntax: checkindex(Bool, Range, Index) Parameters: This function accepts three parameters which are illustrated below:- Bool: This says that this fun 2 min read Julia | checkbounds() function with examples The checkbounds() is an inbuilt function in julia which is used to return true if the given index value lies within the bounds of the given array, otherwise returns false. Syntax: checkbounds(Bool, Array, Index) Parameters: This function accepts three parameters which are illustrated below:- Bool: T 2 min read Functions in Julia A function in Julia is an object that maps a tuple of arguments to a return value. Functions are fundamental building blocks in Julia, allowing you to encapsulate logic for reuse and abstraction. They can represent pure mathematical operations or perform actions that modify the state of other object 4 min read Working with DataFrames in Julia A Data frame is a two-dimensional data structure that resembles a table, where the columns represent variables and rows contain values for those variables. It is mutable and can hold various data types. Julia is a high performance, dynamic programming language which has a high-level syntax. The Data 7 min read Expressions and Macros in Julia Metaprogramming is a way to form a well-built code. If this technique is used precisely then it can result in more condensed and readable code. Julia is a homoiconic language, it means that Julia can personify its own code as the data structure for the language itself. It is possible for the program 5 min read Type Annotations in Julia Julia is a dynamically typed language i.e. the type of the variable need not be declared in the program statically. Along with this, it also provides a technique to comment on the type of variable to the Just-in-Time (JIT) compiler at the runtime. Moreover, Julia supports both dynamic as well as sta 3 min read Like