How can I print the output of Dates.today()
in the following format: 30-Jun-23
?
I'm confused by the docs, dateformat
appears to parse a string, but not the other way around (convert a Date
object to a string with specific format)
julia> current_date = Dates.today()
2023-07-01
julia> formatted_date = Dates.format(current_date, "d-U-yy")
"1-July-23"
This seems to do it
Great, thanks. It is there in the docs, but only in the list of functions, in the examples it is not mentioned, so I didn't see it.
This is exactly what I wanted:
julia> today = Dates.today()
2023-06-30
julia> Dates.format(today, "dd-u-yy")
"30-Jun-23"
Leandro Martínez has marked this topic as resolved.
Last updated: Nov 06 2024 at 04:40 UTC