# [C Interface](#C-Interface)
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L70-L74)
```julia
Cuintmax_t
```
Equivalent to the native `uintmax_t` c-type ([`UInt64`](../numbers/#Core.UInt64)).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L78-L82)
```julia
Csize_t
```
Equivalent to the native `size_t` c-type (`UInt`).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L54-L58)
```julia
Cssize_t
```
Equivalent to the native `ssize_t` c-type.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L62-L66)
```julia
Cptrdiff_t
```
Equivalent to the native `ptrdiff_t` c-type (`Int`).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L46-L50)
```julia
Cwchar_t
```
Equivalent to the native `wchar_t` c-type ([`Int32`](../numbers/#Core.Int32)).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/c.jl#L118-L122)
```julia
Cwstring
```
A C-style string composed of the native wide character type [`Cwchar_t`](#Base.Cwchar_t)s. `Cwstring`s are NUL-terminated. For C-style strings composed of the native character type, see [`Cstring`](#Base.Cstring). For more information about string interoperability with C, see the [manual](../../manual/calling-c-and-fortran-code/#man-bits-types).


# [C Interface](#C-Interface)
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/strings/cstring.jl#L5-L15)
```julia
Cfloat
```
Equivalent to the native `float` c-type ([`Float32`](../numbers/#Core.Float32)).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L102-L106)
```julia
Cdouble
```
Equivalent to the native `double` c-type ([`Float64`](../numbers/#Core.Float64)).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/ctypes.jl#L110-L114)


# [LLVM Interface](#LLVM-Interface)
```julia
llvmcall(fun_ir::String, returntype, Tuple{argtype1, ...}, argvalue1, ...)
llvmcall((mod_ir::String, entry_fn::String), returntype, Tuple{argtype1, ...}, argvalue1, ...)
llvmcall((mod_bc::Vector{UInt8}, entry_fn::String), returntype, Tuple{argtype1, ...}, argvalue1, ...)
```
Call the LLVM code provided in the first argument. There are several ways to specify this first argument:
-   as a literal string, representing function-level IR (similar to an LLVM `define` block), with arguments are available as consecutive unnamed SSA variables (%0, %1, etc.);
-   as a 2-element tuple, containing a string of module IR and a string representing the name of the entry-point function to call;
-   as a 2-element tuple, but with the module provided as an `Vector{UInt8}` with bitcode.
Note that contrary to `ccall`, the argument types must be specified as a tuple type, and not a tuple of types. All types, as well as the LLVM code, should be specified as literals, and not as variables or expressions (it may be necessary to use `@eval` to generate these literals).
[Opaque pointers](https://llvm.org/docs/OpaquePointers.html) (written as `ptr`) are not allowed in the LLVM code.
See [`test/llvmcall.jl`](https://github.com/JuliaLang/julia/blob/v1.11.6/test/llvmcall.jl) for usage examples.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/docs/basedocs.jl#L1325-L1349)
------------------------------------------------------------------------


# C Standard Library · The Julia Language
Source: https://docs.julialang.org/en/v1/base/libc/


# [C Standard Library](#C-Standard-Library)
```julia
malloc(size::Integer) -> Ptr{Cvoid}
```
Call `malloc` from the C standard library.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L387-L391)
```julia
calloc(num::Integer, size::Integer) -> Ptr{Cvoid}
```
Call `calloc` from the C standard library.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L404-L408)
```julia
realloc(addr::Ptr, size::Integer) -> Ptr{Cvoid}
```
Call `realloc` from the C standard library.
See warning in the documentation for [`free`](#Base.Libc.free) regarding only using this on memory originally obtained from [`malloc`](#Base.Libc.malloc).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L394-L401)
```julia
memcpy(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}
```
Call `memcpy` from the C standard library.
Support for `memcpy` requires at least Julia 1.10.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/cmem.jl#L3-L11)
```julia
memmove(dst::Ptr, src::Ptr, n::Integer) -> Ptr{Cvoid}
```
Call `memmove` from the C standard library.
Support for `memmove` requires at least Julia 1.10.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/cmem.jl#L17-L25)
```julia
memset(dst::Ptr, val, n::Integer) -> Ptr{Cvoid}
```
Call `memset` from the C standard library.
Support for `memset` requires at least Julia 1.10.


# [C Standard Library](#C-Standard-Library)
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/cmem.jl#L31-L39)
```julia
memcmp(a::Ptr, b::Ptr, n::Integer) -> Int
```
Call `memcmp` from the C standard library.
Support for `memcmp` requires at least Julia 1.9.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/cmem.jl#L45-L53)
```julia
free(addr::Ptr)
```
Call `free` from the C standard library. Only use this on memory obtained from [`malloc`](#Base.Libc.malloc), not on pointers retrieved from other C libraries. [`Ptr`](../c/#Core.Ptr) objects obtained from C libraries should be freed by the free functions defined in that library, to avoid assertion failures if multiple `libc` libraries exist on the system.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L375-L382)
```julia
errno([code])
```
Get the value of the C library's `errno`. If an argument is specified, it is used to set the value of `errno`.
The value of `errno` is only valid immediately after a `ccall` to a C library routine that sets it. Specifically, you cannot call `errno` at the next prompt in a REPL, because lots of code is executed between prompts.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L316-L325)
```julia
strerror(n=errno())
```
Convert a system call error code to a descriptive string
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L329-L333)


# [C Standard Library](#C-Standard-Library)
```julia
GetLastError()
```
Call the Win32 `GetLastError` function \[only available on Windows\].
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L337-L341)
```julia
FormatMessage(n=GetLastError())
```
Convert a Win32 system call error code to a descriptive string \[only available on Windows\].
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L344-L348)
```julia
time(t::TmStruct) -> Float64
```
Converts a `TmStruct` struct to a number of seconds since the epoch.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L273-L277)
```julia
strftime([format], time)
```
Convert time, given as a number of seconds since the epoch or a `TmStruct`, to a formatted string using the given format. Supported formats are the same as those in the standard C library.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L221-L227)
```julia
strptime([format], timestr)
```
Parse a formatted time string into a `TmStruct` giving the seconds, minute, hour, date, etc. Supported formats are the same as those in the standard C library. On some platforms, timezones will not be parsed correctly. If the result of this function will be passed to `time` to convert it to seconds since the epoch, the `isdst` field should be filled in manually. Setting it to `-1` will tell the C library to use the current system settings to determine the timezone.


# [C Standard Library](#C-Standard-Library)
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L239-L248)
```julia
TmStruct([seconds])
```
Convert a number of seconds since the epoch to broken-down format, with fields `sec`, `min`, `hour`, `mday`, `month`, `year`, `wday`, `yday`, and `isdst`.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L186-L191)
```julia
FILE(::Ptr)
FILE(::IO)
```
A libc `FILE*`, representing an opened file.
It can be passed as a `Ptr{FILE}` argument to [`ccall`](../c/#ccall) and also supports [`seek`](../io-network/#Base.seek), [`position`](../io-network/#Base.position) and [`close`](../io-network/#Base.close).
A `FILE` can be constructed from an ordinary `IO` object, provided it is an open file. It must be closed afterward.
**Examples**
```julia-repl
julia> using Base.Libc

julia> mktemp() do _, io
           # write to the temporary file using `puts(char*, FILE*)` from libc
           file = FILE(io)
           ccall(:fputs, Cint, (Cstring, Ptr{FILE}), "hello world", file)
           close(file)
           # read the file again
           seek(io, 0)
           read(io, String)
       end
"hello world"
```
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L83-L110)
```julia
flush_cstdio()
```
Flushes the C `stdout` and `stderr` streams (which may have been written to by external C code).


# [C Standard Library](#C-Standard-Library)
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L143-L147)
```julia
systemsleep(s::Real)
```
Suspends execution for `s` seconds. This function does not yield to Julia's scheduler and therefore blocks the Julia thread that it is running on for the duration of the sleep time.
See also [`sleep`](../parallel/#Base.sleep).
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L163-L171)
```julia
mkfifo(path::AbstractString, [mode::Integer]) -> path
```
Make a FIFO special file (a named pipe) at `path`. Return `path` as-is on success.
`mkfifo` is supported only in Unix platforms.
`mkfifo` requires at least Julia 1.11.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/libc.jl#L445-L454)
------------------------------------------------------------------------


# StackTraces · The Julia Language
Source: https://docs.julialang.org/en/v1/base/stacktraces/


# [StackTraces](#StackTraces)
```julia
StackFrame
```
Stack information representing execution context, with the following fields:
-   `func::Symbol`
    The name of the function containing the execution context.
-   `linfo::Union{Core.MethodInstance, Method, Module, Core.CodeInfo, Nothing}`
    The MethodInstance or CodeInfo containing the execution context (if it could be found), or Module (for macro expansions)"
-   `file::Symbol`
    The path to the file containing the execution context.
-   `line::Int`
    The line number in the file containing the execution context.
-   `from_c::Bool`
    True if the code is from C.
-   `inlined::Bool`
    True if the code is from an inlined frame.
-   `pointer::UInt64`
    Representation of the pointer to the execution context as returned by `backtrace`.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L14-L47)
```julia
StackTrace
```
An alias for `Vector{StackFrame}` provided for convenience; returned by calls to `stacktrace`.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L70-L75)
```julia
stacktrace([trace::Vector{Ptr{Cvoid}},] [c_funcs::Bool=false]) -> StackTrace
```
Return a stack trace in the form of a vector of `StackFrame`s. (By default stacktrace doesn't return C functions, but this can be enabled.) When called without specifying a trace, `stacktrace` first calls `backtrace`.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L154-L160)


# [StackTraces](#StackTraces)
The following methods and types in `Base.StackTraces` are not exported and need to be called e.g. as `StackTraces.lookup(ptr)`.
```julia
lookup(pointer::Ptr{Cvoid}) -> Vector{StackFrame}
```
Given a pointer to an execution context (usually generated by a call to `backtrace`), looks up stack frame context information. Returns an array of frame information for all functions inlined at that point, innermost function first.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L100-L106)
```julia
remove_frames!(stack::StackTrace, name::Symbol)
```
Takes a `StackTrace` (a vector of `StackFrames`) and a function name (a `Symbol`) and removes the `StackFrame` specified by the function name from the `StackTrace` (also removing all frames above the specified function). Primarily used to remove `StackTraces` functions from the `StackTrace` prior to returning it.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L183-L190)
```julia
remove_frames!(stack::StackTrace, m::Module)
```
Return the `StackTrace` with all `StackFrame`s from the provided `Module` removed.
[source](https://github.com/JuliaLang/julia/blob/9615af0f269df4d371b8010e9507ed5bae86103b/base/stacktraces.jl#L201-L205)
------------------------------------------------------------------------


# SIMD Support · The Julia Language
Source: https://docs.julialang.org/en/v1/base/simd-types/


# [SIMD Support](#SIMD-Support)
Type `VecElement{T}` is intended for building libraries of SIMD operations. Practical use of it requires using `llvmcall`. The type is defined as:
```julia
struct VecElement{T}
    value::T
end
```
It has a special compilation rule: a homogeneous tuple of `VecElement{T}` maps to an LLVM `vector` type when `T` is a primitive bits type.
At `-O3`, the compiler *might* automatically vectorize operations on such tuples. For example, the following program, when compiled with `julia -O3` generates two SIMD addition instructions (`addps`) on x86 systems:
```julia
const m128 = NTuple{4,VecElement{Float32}}

function add(a::m128, b::m128)
    (VecElement(a[1].value+b[1].value),
     VecElement(a[2].value+b[2].value),
     VecElement(a[3].value+b[3].value),
     VecElement(a[4].value+b[4].value))
end

triple(c::m128) = add(add(c,c),c)

code_native(triple,(m128,))
```
However, since the automatic vectorization cannot be relied upon, future use will mostly be via libraries that use `llvmcall`.
------------------------------------------------------------------------


# ArgTools · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/ArgTools/


# [ArgTools](#ArgTools)


## [Argument Handling](#Argument-Handling)
```julia
ArgRead = Union{AbstractString, AbstractCmd, IO}
```
The `ArgRead` types is a union of the types that the `arg_read` function knows how to convert into readable IO handles. See [`arg_read`](#ArgTools.arg_read) for details.
```julia
ArgWrite = Union{AbstractString, AbstractCmd, IO}
```
The `ArgWrite` types is a union of the types that the `arg_write` function knows how to convert into writeable IO handles, except for `Nothing` which `arg_write` handles by generating a temporary file. See [`arg_write`](#ArgTools.arg_write) for details.
```julia
arg_read(f::Function, arg::ArgRead) -> f(arg_io)
```
The `arg_read` function accepts an argument `arg` that can be any of these:
-   `AbstractString`: a file path to be opened for reading
-   `AbstractCmd`: a command to be run, reading from its standard output
-   `IO`: an open IO handle to be read from
Whether the body returns normally or throws an error, a path which is opened will be closed before returning from `arg_read` and an `IO` handle will be flushed but not closed before returning from `arg_read`.
Note: when opening a file, ArgTools will pass `lock = false` to the file `open(...)` call. Therefore, the object returned by this function should not be used from multiple threads. This restriction may be relaxed in the future, which would not break any working code.
```julia
arg_write(f::Function, arg::ArgWrite) -> arg
arg_write(f::Function, arg::Nothing) -> tempname()
```
The `arg_read` function accepts an argument `arg` that can be any of these:


## [Argument Handling](#Argument-Handling)
-   `AbstractString`: a file path to be opened for writing
-   `AbstractCmd`: a command to be run, writing to its standard input
-   `IO`: an open IO handle to be written to
-   `Nothing`: a temporary path should be written to
If the body returns normally, a path that is opened will be closed upon completion; an IO handle argument is left open but flushed before return. If the argument is `nothing` then a temporary path is opened for writing and closed open completion and the path is returned from `arg_write`. In all other cases, `arg` itself is returned. This is a useful pattern since you can consistently return whatever was written, whether an argument was passed or not.
If there is an error during the evaluation of the body, a path that is opened by `arg_write` for writing will be deleted, whether it's passed in as a string or a temporary path generated when `arg` is `nothing`.
Note: when opening a file, ArgTools will pass `lock = false` to the file `open(...)` call. Therefore, the object returned by this function should not be used from multiple threads. This restriction may be relaxed in the future, which would not break any working code.
```julia
arg_isdir(f::Function, arg::AbstractString) -> f(arg)
```


## [Argument Handling](#Argument-Handling)
The `arg_isdir` function takes `arg` which must be the path to an existing directory (an error is raised otherwise) and passes that path to `f` finally returning the result of `f(arg)`. This is definitely the least useful tool offered by `ArgTools` and mostly exists for symmetry with `arg_mkdir` and to give consistent error messages.
```julia
arg_mkdir(f::Function, arg::AbstractString) -> arg
arg_mkdir(f::Function, arg::Nothing) -> mktempdir()
```
The `arg_mkdir` function takes `arg` which must either be one of:
-   a path to an already existing empty directory,
-   a non-existent path which can be created as a directory, or
-   `nothing` in which case a temporary directory is created.
In all cases the path to the directory is returned. If an error occurs during `f(arg)`, the directory is returned to its original state: if it already existed but was empty, it will be emptied; if it did not exist it will be deleted.


## [Function Testing](#Function-Testing)
```julia
arg_readers(arg :: AbstractString, [ type = ArgRead ]) do arg::Function
    ## pre-test setup ##
    @arg_test arg begin
        arg :: ArgRead
        ## test using `arg` ##
    end
    ## post-test cleanup ##
end
```
The `arg_readers` function takes a path to be read and a single-argument do block, which is invoked once for each test reader type that `arg_read` can handle. If the optional `type` argument is given then the do block is only invoked for readers that produce arguments of that type.
The `arg` passed to the do block is not the argument value itself, because some of test argument types need to be initialized and finalized for each test case. Consider an open file handle argument: once you've used it for one test, you can't use it again; you need to close it and open the file again for the next test. This function `arg` can be converted into an `ArgRead` instance using `@arg_test arg begin ... end`.
```julia
arg_writers([ type = ArgWrite ]) do path::String, arg::Function
    ## pre-test setup ##
    @arg_test arg begin
        arg :: ArgWrite
        ## test using `arg` ##
    end
    ## post-test cleanup ##
end
```
The `arg_writers` function takes a do block, which is invoked once for each test writer type that `arg_write` can handle with a temporary (non-existent) `path` and `arg` which can be converted into various writable argument types which write to `path`. If the optional `type` argument is given then the do block is only invoked for writers that produce arguments of that type.


## [Function Testing](#Function-Testing)
The `arg` passed to the do block is not the argument value itself, because some of test argument types need to be initialized and finalized for each test case. Consider an open file handle argument: once you've used it for one test, you can't use it again; you need to close it and open the file again for the next test. This function `arg` can be converted into an `ArgWrite` instance using `@arg_test arg begin ... end`.
There is also an `arg_writers` method that takes a path name like `arg_readers`:
```julia
arg_writers(path::AbstractString, [ type = ArgWrite ]) do arg::Function
    ## pre-test setup ##
    @arg_test arg begin
        # here `arg :: ArgWrite`
        ## test using `arg` ##
    end
    ## post-test cleanup ##
end
```
This method is useful if you need to specify `path` instead of using path name generated by `tempname()`. Since `path` is passed from outside of `arg_writers`, the path is not an argument to the do block in this form.
```julia
@arg_test arg1 arg2 ... body
```
The `@arg_test` macro is used to convert `arg` functions provided by `arg_readers` and `arg_writers` into actual argument values. When you write `@arg_test arg body` it is equivalent to `arg(arg -> body)`.
------------------------------------------------------------------------


# Artifacts · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/Artifacts/


# [Artifacts](#Artifacts)
Starting with Julia 1.6, the artifacts support has moved from `Pkg.jl` to Julia itself. Until proper documentation can be added here, you can learn more about artifacts in the `Pkg.jl` manual at <https://julialang.github.io/Pkg.jl/v1/artifacts/>.
Julia's artifacts API requires at least Julia 1.6. In Julia versions 1.3 to 1.5, you can use `Pkg.Artifacts` instead.
```julia
artifact_meta(name::String, artifacts_toml::String;
              platform::AbstractPlatform = HostPlatform(),
              pkg_uuid::Union{Base.UUID,Nothing}=nothing)
```
Get metadata about a given artifact (identified by name) stored within the given `(Julia)Artifacts.toml` file. If the artifact is platform-specific, use `platform` to choose the most appropriate mapping. If none is found, return `nothing`.
This function requires at least Julia 1.3.
```julia
artifact_hash(name::String, artifacts_toml::String;
              platform::AbstractPlatform = HostPlatform())
```
Thin wrapper around `artifact_meta()` to return the hash of the specified, platform- collapsed artifact. Returns `nothing` if no mapping can be found.
This function requires at least Julia 1.3.
```julia
find_artifacts_toml(path::String)
```
Given the path to a `.jl` file, (such as the one returned by `__source__.file` in a macro context), find the `(Julia)Artifacts.toml` that is contained within the containing project (if it exists), otherwise return `nothing`.
This function requires at least Julia 1.3.
```julia
macro artifact_str(name)
```


# [Artifacts](#Artifacts)
Return the on-disk path to an artifact. Automatically looks the artifact up by name in the project's `(Julia)Artifacts.toml` file. Throws an error on if the requested artifact is not present. If run in the REPL, searches for the toml file starting in the current directory, see `find_artifacts_toml()` for more.
If the artifact is marked "lazy" and the package has `using LazyArtifacts` defined, the artifact will be downloaded on-demand with `Pkg` the first time this macro tries to compute the path. The files will then be left installed locally for later.
If `name` contains a forward or backward slash, all elements after the first slash will be taken to be path names indexing into the artifact, allowing for an easy one-liner to access a single file/directory within an artifact. Example:
```julia
ffmpeg_path = @artifact"FFMPEG/bin/ffmpeg"
```
This macro requires at least Julia 1.3.
Slash-indexing requires at least Julia 1.6.
```julia
artifact_exists(hash::SHA1; honor_overrides::Bool=true)
```
Return whether or not the given artifact (identified by its sha1 git tree hash) exists on-disk. Note that it is possible that the given artifact exists in multiple locations (e.g. within multiple depots).
This function requires at least Julia 1.3.
```julia
artifact_path(hash::SHA1; honor_overrides::Bool=true)
```
Given an artifact (identified by SHA1 git tree hash), return its installation path. If the artifact does not exist, returns the location it would be installed to.
This function requires at least Julia 1.3.


# [Artifacts](#Artifacts)
```julia
select_downloadable_artifacts(artifacts_toml::String;
                              platform = HostPlatform,
                              include_lazy = false,
                              pkg_uuid = nothing)
```
Return a dictionary where every entry is an artifact from the given `Artifacts.toml` that should be downloaded for the requested platform. Lazy artifacts are included if `include_lazy` is set.
------------------------------------------------------------------------


# Base64 · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/Base64/


# [Base64](#Base64)
```julia
Base64
```
Functionality for [base64 encoding and decoding](https://en.wikipedia.org/wiki/Base64), a method to represent binary data using text, common on the web.
```julia
Base64EncodePipe(ostream)
```
Return a new write-only I/O stream, which converts any bytes written to it into base64-encoded ASCII bytes written to `ostream`. Calling [`close`](../../base/io-network/#Base.close) on the `Base64EncodePipe` stream is necessary to complete the encoding (but does not close `ostream`).
**Examples**
```julia-repl
julia> io = IOBuffer();

julia> iob64_encode = Base64EncodePipe(io);

julia> write(iob64_encode, "Hello!")
6

julia> close(iob64_encode);

julia> str = String(take!(io))
"SGVsbG8h"

julia> String(base64decode(str))
"Hello!"
```
```julia
base64encode(writefunc, args...; context=nothing)
base64encode(args...; context=nothing)
```
Given a [`write`](../../base/io-network/#Base.write)-like function `writefunc`, which takes an I/O stream as its first argument, `base64encode(writefunc, args...)` calls `writefunc` to write `args...` to a base64-encoded string, and returns the string. `base64encode(args...)` is equivalent to `base64encode(write, args...)`: it converts its arguments into bytes using the standard [`write`](../../base/io-network/#Base.write) functions and returns the base64-encoded string.
The optional keyword argument `context` can be set to `:key=>value` pair or an `IO` or [`IOContext`](../../base/io-network/#Base.IOContext) object whose attributes are used for the I/O stream passed to `writefunc` or `write`.


# [Base64](#Base64)
See also [`base64decode`](#Base64.base64decode).
```julia
Base64DecodePipe(istream)
```
Return a new read-only I/O stream, which decodes base64-encoded data read from `istream`.
**Examples**
```julia-repl
julia> io = IOBuffer();

julia> iob64_decode = Base64DecodePipe(io);

julia> write(io, "SGVsbG8h")
8

julia> seekstart(io);

julia> String(read(iob64_decode))
"Hello!"
```
```julia
base64decode(string)
```
Decode the base64-encoded `string` and returns a `Vector{UInt8}` of the decoded bytes.
See also [`base64encode`](#Base64.base64encode).
**Examples**
```julia-repl
julia> b = base64decode("SGVsbG8h")
6-element Vector{UInt8}:
 0x48
 0x65
 0x6c
 0x6c
 0x6f
 0x21

julia> String(b)
"Hello!"
```
```julia
stringmime(mime, x; context=nothing)
```
Return an `AbstractString` containing the representation of `x` in the requested `mime` type. This is similar to [`repr(mime, x)`](../../base/io-network/#Base.repr-Tuple%7BMIME,%20Any%7D) except that binary data is base64-encoded as an ASCII string.
The optional keyword argument `context` can be set to `:key=>value` pair or an `IO` or [`IOContext`](../../base/io-network/#Base.IOContext) object whose attributes are used for the I/O stream passed to [`show`](../../base/io-network/#Base.show-Tuple%7BIO,%20Any%7D).
------------------------------------------------------------------------


# CRC32c · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/CRC32c/


# [CRC32c](#CRC32c)
Standard library module for computing the CRC-32c checksum.
```julia
crc32c(data, crc::UInt32=0x00000000)
```
Compute the CRC-32c checksum of the given `data`, which can be an `Array{UInt8}`, a contiguous subarray thereof, or a `String`. Optionally, you can pass a starting `crc` integer to be mixed in with the checksum. The `crc` parameter can be used to compute a checksum on data divided into chunks: performing `crc32c(data2, crc32c(data1))` is equivalent to the checksum of `[data1; data2]`. (Technically, a little-endian checksum is computed.)
There is also a method `crc32c(io, nb, crc)` to checksum `nb` bytes from a stream `io`, or `crc32c(io, crc)` to checksum all the remaining bytes. Hence you can do [`open(crc32c, filename)`](../../base/io-network/#Base.open) to checksum an entire file, or `crc32c(seekstart(buf))` to checksum an [`IOBuffer`](../../base/io-network/#Base.IOBuffer) without calling [`take!`](../../base/io-network/#Base.take!-Tuple%7BBase.GenericIOBuffer%7D).
For a `String`, note that the result is specific to the UTF-8 encoding (a different checksum would be obtained from a different Unicode encoding). To checksum an `a::Array` of some other bitstype, you can do `crc32c(reinterpret(UInt8,a))`, but note that the result may be endian-dependent.
```julia
crc32c(io::IO, [nb::Integer,] crc::UInt32=0x00000000)
```
Read up to `nb` bytes from `io` and return the CRC-32c checksum, optionally mixed with a starting `crc` integer. If `nb` is not supplied, then `io` will be read until the end of the stream.


# [CRC32c](#CRC32c)
------------------------------------------------------------------------


# Dates · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/Dates/


# [Dates](#Dates)
The `Dates` module provides two types for working with dates: [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime), representing day and millisecond precision, respectively; both are subtypes of the abstract [`TimeType`](#Dates.TimeType). The motivation for distinct types is simple: some operations are much simpler, both in terms of code and mental reasoning, when the complexities of greater precision don't have to be dealt with. For example, since the [`Date`](#Dates.Date) type only resolves to the precision of a single date (i.e. no hours, minutes, or seconds), normal considerations for time zones, daylight savings/summer time, and leap seconds are unnecessary and avoided.


# [Dates](#Dates)
Both [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) are basically immutable [`Int64`](../../base/numbers/#Core.Int64) wrappers. The single `instant` field of either type is actually a `UTInstant{P}` type, which represents a continuously increasing machine timeline based on the UT second <sup>[[1\]](#footnote-1)</sup>. The [`DateTime`](#Dates.DateTime) type is not aware of time zones (*naive*, in Python parlance), analogous to a *LocalDateTime* in Java 8. Additional time zone functionality can be added through the [TimeZones.jl package](https://github.com/JuliaTime/TimeZones.jl/), which compiles the [IANA time zone database](https://www.iana.org/time-zones). Both [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) are based on the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard, which follows the proleptic Gregorian calendar. One note is that the ISO 8601 standard is particular about BC/BCE dates. In general, the last day of the BC/BCE era, 1-12-31 BC/BCE, was followed by 1-1-1 AD/CE, thus no year zero exists. The ISO standard, however, states that 1 BC/BCE is year zero, so `0000-12-31` is the day before `0001-01-01`, and year `-0001` (yes, negative one for the year) is 2 BC/BCE, year `-0002` is 3 BC/BCE, etc.


## [Constructors](#Constructors)
[`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) types can be constructed by integer or [`Period`](#Dates.Period) types, by parsing, or through adjusters (more on those later):
```julia-repl
julia> DateTime(2013)
2013-01-01T00:00:00

julia> DateTime(2013,7)
2013-07-01T00:00:00

julia> DateTime(2013,7,1)
2013-07-01T00:00:00

julia> DateTime(2013,7,1,12)
2013-07-01T12:00:00

julia> DateTime(2013,7,1,12,30)
2013-07-01T12:30:00

julia> DateTime(2013,7,1,12,30,59)
2013-07-01T12:30:59

julia> DateTime(2013,7,1,12,30,59,1)
2013-07-01T12:30:59.001

julia> Date(2013)
2013-01-01

julia> Date(2013,7)
2013-07-01

julia> Date(2013,7,1)
2013-07-01

julia> Date(Dates.Year(2013),Dates.Month(7),Dates.Day(1))
2013-07-01

julia> Date(Dates.Month(7),Dates.Year(2013))
2013-07-01
```
[`Date`](#Dates.Date) or [`DateTime`](#Dates.DateTime) parsing is accomplished by the use of format strings. Format strings work by the notion of defining *delimited* or *fixed-width* "slots" that contain a period to parse and passing the text to parse and format string to a [`Date`](#Dates.Date) or [`DateTime`](#Dates.DateTime) constructor, of the form `Date("2015-01-01",dateformat"y-m-d")` or `DateTime("20150101",dateformat"yyyymmdd")`.


## [Constructors](#Constructors)
Delimited slots are marked by specifying the delimiter the parser should expect between two subsequent periods; so `"y-m-d"` lets the parser know that between the first and second slots in a date string like `"2014-07-16"`, it should find the `-` character. The `y`, `m`, and `d` characters let the parser know which periods to parse in each slot.
As in the case of constructors above such as `Date(2013)`, delimited `DateFormat`s allow for missing parts of dates and times so long as the preceding parts are given. The other parts are given the usual default values. For example, `Date("1981-03", dateformat"y-m-d")` returns `1981-03-01`, whilst `Date("31/12", dateformat"d/m/y")` gives `0001-12-31`. (Note that the default year is 1 AD/CE.) An empty string, however, always throws an `ArgumentError`.
Fixed-width slots are specified by repeating the period character the number of times corresponding to the width with no delimiter between characters. So `dateformat"yyyymmdd"` would correspond to a date string like `"20140716"`. The parser distinguishes a fixed-width slot by the absence of a delimiter, noting the transition `"yyyymm"` from one period character to the next.


## [Constructors](#Constructors)
Support for text-form month parsing is also supported through the `u` and `U` characters, for abbreviated and full-length month names, respectively. By default, only English month names are supported, so `u` corresponds to "Jan", "Feb", "Mar", etc. And `U` corresponds to "January", "February", "March", etc. Similar to other name=>value mapping functions [`dayname`](#Dates.dayname) and [`monthname`](#Dates.monthname), custom locales can be loaded by passing in the `locale=>Dict{String,Int}` mapping to the `MONTHTOVALUEABBR` and `MONTHTOVALUE` dicts for abbreviated and full-name month names, respectively.
The above examples used the `dateformat""` string macro. This macro creates a `DateFormat` object once when the macro is expanded and uses the same `DateFormat` object even if a code snippet is run multiple times.
```julia-repl
julia> for i = 1:10^5
           Date("2015-01-01", dateformat"y-m-d")
       end
```
Or you can create the DateFormat object explicitly:
```julia-repl
julia> df = DateFormat("y-m-d");

julia> dt = Date("2015-01-01",df)
2015-01-01

julia> dt2 = Date("2015-01-02",df)
2015-01-02
```
Alternatively, use broadcasting:
```julia-repl
julia> years = ["2015", "2016"];

julia> Date.(years, DateFormat("yyyy"))
2-element Vector{Date}:
 2015-01-01
 2016-01-01
```
For convenience, you may pass the format string directly (e.g., `Date("2015-01-01","y-m-d")`), although this form incurs performance costs if you are parsing the same format repeatedly, as it internally creates a new `DateFormat` object each time.


## [Constructors](#Constructors)
As well as via the constructors, a `Date` or `DateTime` can be constructed from strings using the [`parse`](../../base/numbers/#Base.parse) and [`tryparse`](../../base/numbers/#Base.tryparse) functions, but with an optional third argument of type `DateFormat` specifying the format; for example, `parse(Date, "06.23.2013", dateformat"m.d.y")`, or `tryparse(DateTime, "1999-12-31T23:59:59")` which uses the default format. The notable difference between the functions is that with [`tryparse`](../../base/numbers/#Base.tryparse), an error is not thrown if the string is empty or in an invalid format; instead `nothing` is returned.
Before Julia 1.9, empty strings could be passed to constructors and `parse` without error, returning as appropriate `DateTime(1)`, `Date(1)` or `Time(0)`. Likewise, `tryparse` did not return `nothing`.
A full suite of parsing and formatting tests and examples is available in [`stdlib/Dates/test/io.jl`](https://github.com/JuliaLang/julia/blob/master/stdlib/Dates/test/io.jl).


## [Durations/Comparisons](#Durations/Comparisons)
Finding the length of time between two [`Date`](#Dates.Date) or [`DateTime`](#Dates.DateTime) is straightforward given their underlying representation as `UTInstant{Day}` and `UTInstant{Millisecond}`, respectively. The difference between [`Date`](#Dates.Date) is returned in the number of [`Day`](#Dates.Day-Tuple%7BTimeType%7D), and [`DateTime`](#Dates.DateTime) in the number of [`Millisecond`](#Dates.Millisecond-Tuple%7BDateTime%7D). Similarly, comparing [`TimeType`](#Dates.TimeType) is a simple matter of comparing the underlying machine instants (which in turn compares the internal [`Int64`](../../base/numbers/#Core.Int64) values).
```julia-repl
julia> dt = Date(2012,2,29)
2012-02-29

julia> dt2 = Date(2000,2,1)
2000-02-01

julia> dump(dt)
Date
  instant: Dates.UTInstant{Day}
    periods: Day
      value: Int64 734562

julia> dump(dt2)
Date
  instant: Dates.UTInstant{Day}
    periods: Day
      value: Int64 730151

julia> dt > dt2
true

julia> dt != dt2
true

julia> dt + dt2
ERROR: MethodError: no method matching +(::Date, ::Date)
[...]

julia> dt * dt2
ERROR: MethodError: no method matching *(::Date, ::Date)
[...]

julia> dt / dt2
ERROR: MethodError: no method matching /(::Date, ::Date)

julia> dt - dt2
4411 days

julia> dt2 - dt
-4411 days

julia> dt = DateTime(2012,2,29)
2012-02-29T00:00:00

julia> dt2 = DateTime(2000,2,1)
2000-02-01T00:00:00

julia> dt - dt2
381110400000 milliseconds
```


## [Accessor Functions](#Accessor-Functions)
Because the [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) types are stored as single [`Int64`](../../base/numbers/#Core.Int64) values, date parts or fields can be retrieved through accessor functions. The lowercase accessors return the field as an integer:
```julia-repl
julia> t = Date(2014, 1, 31)
2014-01-31

julia> Dates.year(t)
2014

julia> Dates.month(t)
1

julia> Dates.week(t)
5

julia> Dates.day(t)
31
```
While propercase return the same value in the corresponding [`Period`](#Dates.Period) type:
```julia-repl
julia> Dates.Year(t)
2014 years

julia> Dates.Day(t)
31 days
```
Compound methods are provided because it is more efficient to access multiple fields at the same time than individually:
```julia-repl
julia> Dates.yearmonth(t)
(2014, 1)

julia> Dates.monthday(t)
(1, 31)

julia> Dates.yearmonthday(t)
(2014, 1, 31)
```
One may also access the underlying `UTInstant` or integer value:
```julia-repl
julia> dump(t)
Date
  instant: Dates.UTInstant{Day}
    periods: Day
      value: Int64 735264

julia> t.instant
Dates.UTInstant{Day}(Day(735264))

julia> Dates.value(t)
735264
```


## [Query Functions](#Query-Functions)
Query functions provide calendrical information about a [`TimeType`](#Dates.TimeType). They include information about the day of the week:
```julia-repl
julia> t = Date(2014, 1, 31)
2014-01-31

julia> Dates.dayofweek(t)
5

julia> Dates.dayname(t)
"Friday"

julia> Dates.dayofweekofmonth(t) # 5th Friday of January
5
```
Month of the year:
```julia-repl
julia> Dates.monthname(t)
"January"

julia> Dates.daysinmonth(t)
31
```
As well as information about the [`TimeType`](#Dates.TimeType)'s year and quarter:
```julia-repl
julia> Dates.isleapyear(t)
false

julia> Dates.dayofyear(t)
31

julia> Dates.quarterofyear(t)
1

julia> Dates.dayofquarter(t)
31
```
The [`dayname`](#Dates.dayname) and [`monthname`](#Dates.monthname) methods can also take an optional `locale` keyword that can be used to return the name of the day or month of the year for other languages/locales. There are also versions of these functions returning the abbreviated names, namely [`dayabbr`](#Dates.dayabbr) and [`monthabbr`](#Dates.monthabbr). First the mapping is loaded into the `LOCALES` variable:


## [Query Functions](#Query-Functions)
```julia-repl
julia> french_months = ["janvier", "février", "mars", "avril", "mai", "juin",
                        "juillet", "août", "septembre", "octobre", "novembre", "décembre"];

julia> french_months_abbrev = ["janv","févr","mars","avril","mai","juin",
                              "juil","août","sept","oct","nov","déc"];

julia> french_days = ["lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"];

julia> Dates.LOCALES["french"] = Dates.DateLocale(french_months, french_months_abbrev, french_days, [""]);
```
The above mentioned functions can then be used to perform the queries:
```julia-repl
julia> Dates.dayname(t;locale="french")
"vendredi"

julia> Dates.monthname(t;locale="french")
"janvier"

julia> Dates.monthabbr(t;locale="french")
"janv"
```
Since the abbreviated versions of the days are not loaded, trying to use the function `dayabbr` will throw an error.
```julia-repl
julia> Dates.dayabbr(t;locale="french")
ERROR: BoundsError: attempt to access 1-element Vector{String} at index [5]
Stacktrace:
[...]
```


## [TimeType-Period Arithmetic](#TimeType-Period-Arithmetic)
It's good practice when using any language/date framework to be familiar with how date-period arithmetic is handled as there are some [tricky issues](https://codeblog.jonskeet.uk/2010/12/01/the-joys-of-date-time-arithmetic/) to deal with (though much less so for day-precision types).
The `Dates` module approach tries to follow the simple principle of trying to change as little as possible when doing [`Period`](#Dates.Period) arithmetic. This approach is also often known as *calendrical* arithmetic or what you would probably guess if someone were to ask you the same calculation in a conversation. Why all the fuss about this? Let's take a classic example: add 1 month to January 31st, 2014. What's the answer? Javascript will say [March 3](https://markhneedham.com/blog/2009/01/07/javascript-add-a-month-to-a-date/) (assumes 31 days). PHP says [March 2](https://stackoverflow.com/questions/5760262/php-adding-months-to-a-date-while-not-exceeding-the-last-day-of-the-month) (assumes 30 days). The fact is, there is no right answer. In the `Dates` module, it gives the result of February 28th. How does it figure that out? Consider the classic 7-7-7 gambling game in casinos.


## [TimeType-Period Arithmetic](#TimeType-Period-Arithmetic)
Now just imagine that instead of 7-7-7, the slots are Year-Month-Day, or in our example, 2014-01-31. When you ask to add 1 month to this date, the month slot is incremented, so now we have 2014-02-31. Then the day number is checked if it is greater than the last valid day of the new month; if it is (as in the case above), the day number is adjusted down to the last valid day (28). What are the ramifications with this approach? Go ahead and add another month to our date, `2014-02-28 + Month(1) == 2014-03-28`. What? Were you expecting the last day of March? Nope, sorry, remember the 7-7-7 slots. As few slots as possible are going to change, so we first increment the month slot by 1, 2014-03-28, and boom, we're done because that's a valid date. On the other hand, if we were to add 2 months to our original date, 2014-01-31, then we end up with 2014-03-31, as expected. The other ramification of this approach is a loss in associativity when a specific ordering is forced (i.e. adding things in different orders results in different outcomes). For example:
```julia-repl
julia> (Date(2014,1,29)+Dates.Day(1)) + Dates.Month(1)
2014-02-28

julia> (Date(2014,1,29)+Dates.Month(1)) + Dates.Day(1)
2014-03-01
```


## [TimeType-Period Arithmetic](#TimeType-Period-Arithmetic)
What's going on there? In the first line, we're adding 1 day to January 29th, which results in 2014-01-30; then we add 1 month, so we get 2014-02-30, which then adjusts down to 2014-02-28. In the second example, we add 1 month *first*, where we get 2014-02-29, which adjusts down to 2014-02-28, and *then* add 1 day, which results in 2014-03-01. One design principle that helps in this case is that, in the presence of multiple Periods, the operations will be ordered by the Periods' *types*, not their value or positional order; this means `Year` will always be added first, then `Month`, then `Week`, etc. Hence the following *does* result in associativity and Just Works:
```julia-repl
julia> Date(2014,1,29) + Dates.Day(1) + Dates.Month(1)
2014-03-01

julia> Date(2014,1,29) + Dates.Month(1) + Dates.Day(1)
2014-03-01
```
Tricky? Perhaps. What is an innocent `Dates` user to do? The bottom line is to be aware that explicitly forcing a certain associativity, when dealing with months, may lead to some unexpected results, but otherwise, everything should work as expected. Thankfully, that's pretty much the extent of the odd cases in date-period arithmetic when dealing with time in UT (avoiding the "joys" of dealing with daylight savings, leap seconds, etc.).
As a bonus, all period arithmetic objects work directly with ranges:


## [TimeType-Period Arithmetic](#TimeType-Period-Arithmetic)
```julia-repl
julia> dr = Date(2014,1,29):Day(1):Date(2014,2,3)
Date("2014-01-29"):Day(1):Date("2014-02-03")

julia> collect(dr)
6-element Vector{Date}:
 2014-01-29
 2014-01-30
 2014-01-31
 2014-02-01
 2014-02-02
 2014-02-03

julia> dr = Date(2014,1,29):Dates.Month(1):Date(2014,07,29)
Date("2014-01-29"):Month(1):Date("2014-07-29")

julia> collect(dr)
7-element Vector{Date}:
 2014-01-29
 2014-02-28
 2014-03-29
 2014-04-29
 2014-05-29
 2014-06-29
 2014-07-29
```


## [Adjuster Functions](#Adjuster-Functions)
As convenient as date-period arithmetic is, often the kinds of calculations needed on dates take on a *calendrical* or *temporal* nature rather than a fixed number of periods. Holidays are a perfect example; most follow rules such as "Memorial Day = Last Monday of May", or "Thanksgiving = 4th Thursday of November". These kinds of temporal expressions deal with rules relative to the calendar, like first or last of the month, next Tuesday, or the first and third Wednesdays, etc.
The `Dates` module provides the *adjuster* API through several convenient methods that aid in simply and succinctly expressing temporal rules. The first group of adjuster methods deal with the first and last of weeks, months, quarters, and years. They each take a single [`TimeType`](#Dates.TimeType) as input and return or *adjust to* the first or last of the desired period relative to the input.
```julia-repl
julia> Dates.firstdayofweek(Date(2014,7,16)) # Adjusts the input to the Monday of the input's week
2014-07-14

julia> Dates.lastdayofmonth(Date(2014,7,16)) # Adjusts to the last day of the input's month
2014-07-31

julia> Dates.lastdayofquarter(Date(2014,7,16)) # Adjusts to the last day of the input's quarter
2014-09-30
```


## [Adjuster Functions](#Adjuster-Functions)
The next two higher-order methods, [`tonext`](#Dates.tonext-Tuple%7BTimeType,%20Int64%7D), and [`toprev`](#Dates.toprev-Tuple%7BTimeType,%20Int64%7D), generalize working with temporal expressions by taking a `DateFunction` as first argument, along with a starting [`TimeType`](#Dates.TimeType). A `DateFunction` is just a function, usually anonymous, that takes a single [`TimeType`](#Dates.TimeType) as input and returns a [`Bool`](../../base/numbers/#Core.Bool), `true` indicating a satisfied adjustment criterion. For example:
```julia-repl
julia> istuesday = x->Dates.dayofweek(x) == Dates.Tuesday; # Returns true if the day of the week of x is Tuesday

julia> Dates.tonext(istuesday, Date(2014,7,13)) # 2014-07-13 is a Sunday
2014-07-15

julia> Dates.tonext(Date(2014,7,13), Dates.Tuesday) # Convenience method provided for day of the week adjustments
2014-07-15
```
This is useful with the do-block syntax for more complex temporal expressions:
```julia-repl
julia> Dates.tonext(Date(2014,7,13)) do x
           # Return true on the 4th Thursday of November (Thanksgiving)
           Dates.dayofweek(x) == Dates.Thursday &&
           Dates.dayofweekofmonth(x) == 4 &&
           Dates.month(x) == Dates.November
       end
2014-11-27
```
The [`Base.filter`](../../base/collections/#Base.filter) method can be used to obtain all valid dates/moments in a specified range:


## [Adjuster Functions](#Adjuster-Functions)
```julia-repl
# Pittsburgh street cleaning; Every 2nd Tuesday from April to November
# Date range from January 1st, 2014 to January 1st, 2015
julia> dr = Dates.Date(2014):Day(1):Dates.Date(2015);

julia> filter(dr) do x
           Dates.dayofweek(x) == Dates.Tue &&
           Dates.April <= Dates.month(x) <= Dates.Nov &&
           Dates.dayofweekofmonth(x) == 2
       end
8-element Vector{Date}:
 2014-04-08
 2014-05-13
 2014-06-10
 2014-07-08
 2014-08-12
 2014-09-09
 2014-10-14
 2014-11-11
```
Additional examples and tests are available in [`stdlib/Dates/test/adjusters.jl`](https://github.com/JuliaLang/julia/blob/master/stdlib/Dates/test/adjusters.jl).


## [Period Types](#Period-Types)
Periods are a human view of discrete, sometimes irregular durations of time. Consider 1 month; it could represent, in days, a value of 28, 29, 30, or 31 depending on the year and month context. Or a year could represent 365 or 366 days in the case of a leap year. [`Period`](#Dates.Period) types are simple [`Int64`](../../base/numbers/#Core.Int64) wrappers and are constructed by wrapping any `Int64` convertible type, i.e. `Year(1)` or `Month(3.0)`. Arithmetic between [`Period`](#Dates.Period) of the same type behave like integers, and limited `Period-Real` arithmetic is available. You can extract the underlying integer with [`Dates.value`](#Dates.value).
```julia-repl
julia> y1 = Dates.Year(1)
1 year

julia> y2 = Dates.Year(2)
2 years

julia> y3 = Dates.Year(10)
10 years

julia> y1 + y2
3 years

julia> div(y3,y2)
5

julia> y3 - y2
8 years

julia> y3 % y2
0 years

julia> div(y3,3) # mirrors integer division
3 years

julia> Dates.value(Dates.Millisecond(10))
10
```
Representing periods or durations that are not integer multiples of the basic types can be achieved with the [`Dates.CompoundPeriod`](#Dates.CompoundPeriod) type. Compound periods may be constructed manually from simple [`Period`](#Dates.Period) types. Additionally, the [`canonicalize`](#Dates.canonicalize) function can be used to break down a period into a [`Dates.CompoundPeriod`](#Dates.CompoundPeriod). This is particularly useful to convert a duration, e.g., a difference of two `DateTime`, into a more convenient representation.


## [Period Types](#Period-Types)
```julia-repl
julia> cp = Dates.CompoundPeriod(Day(1),Minute(1))
1 day, 1 minute

julia> t1 = DateTime(2018,8,8,16,58,00)
2018-08-08T16:58:00

julia> t2 = DateTime(2021,6,23,10,00,00)
2021-06-23T10:00:00

julia> canonicalize(t2-t1) # creates a CompoundPeriod
149 weeks, 6 days, 17 hours, 2 minutes
```


## [Rounding](#Rounding)
[`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) values can be rounded to a specified resolution (e.g., 1 month or 15 minutes) with [`floor`](../../base/math/#Base.floor), [`ceil`](../../base/math/#Base.ceil), or [`round`](../../base/math/#Base.round):
```julia-repl
julia> floor(Date(1985, 8, 16), Dates.Month)
1985-08-01

julia> ceil(DateTime(2013, 2, 13, 0, 31, 20), Dates.Minute(15))
2013-02-13T00:45:00

julia> round(DateTime(2016, 8, 6, 20, 15), Dates.Day)
2016-08-07T00:00:00
```
Unlike the numeric [`round`](../../base/math/#Base.round) method, which breaks ties toward the even number by default, the [`TimeType`](#Dates.TimeType)[`round`](../../base/math/#Base.round) method uses the `RoundNearestTiesUp` rounding mode. (It's difficult to guess what breaking ties to nearest "even" [`TimeType`](#Dates.TimeType) would entail.) Further details on the available `RoundingMode` s can be found in the [API reference](#stdlib-dates-api).
Rounding should generally behave as expected, but there are a few cases in which the expected behaviour is not obvious.


### [Rounding Epoch](#Rounding-Epoch)
In many cases, the resolution specified for rounding (e.g., `Dates.Second(30)`) divides evenly into the next largest period (in this case, `Dates.Minute(1)`). But rounding behaviour in cases in which this is not true may lead to confusion. What is the expected result of rounding a [`DateTime`](#Dates.DateTime) to the nearest 10 hours?
```julia-repl
julia> round(DateTime(2016, 7, 17, 11, 55), Dates.Hour(10))
2016-07-17T12:00:00
```
That may seem confusing, given that the hour (12) is not divisible by 10. The reason that `2016-07-17T12:00:00` was chosen is that it is 17,676,660 hours after `0000-01-01T00:00:00`, and 17,676,660 is divisible by 10.
As Julia [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) values are represented according to the ISO 8601 standard, `0000-01-01T00:00:00` was chosen as base (or "rounding epoch") from which to begin the count of days (and milliseconds) used in rounding calculations. (Note that this differs slightly from Julia's internal representation of [`Date`](#Dates.Date) s using [Rata Die notation](https://en.wikipedia.org/wiki/Rata_Die); but since the ISO 8601 standard is most visible to the end user, `0000-01-01T00:00:00` was chosen as the rounding epoch instead of the `0000-12-31T00:00:00` used internally to minimize confusion.)


### [Rounding Epoch](#Rounding-Epoch)
The only exception to the use of `0000-01-01T00:00:00` as the rounding epoch is when rounding to weeks. Rounding to the nearest week will always return a Monday (the first day of the week as specified by ISO 8601). For this reason, we use `0000-01-03T00:00:00` (the first day of the first week of year 0000, as defined by ISO 8601) as the base when rounding to a number of weeks.
Here is a related case in which the expected behaviour is not necessarily obvious: What happens when we round to the nearest `P(2)`, where `P` is a [`Period`](#Dates.Period) type? In some cases (specifically, when `P <: Dates.TimePeriod`) the answer is clear:
```julia-repl
julia> round(DateTime(2016, 7, 17, 8, 55, 30), Dates.Hour(2))
2016-07-17T08:00:00

julia> round(DateTime(2016, 7, 17, 8, 55, 30), Dates.Minute(2))
2016-07-17T08:56:00
```
This seems obvious, because two of each of these periods still divides evenly into the next larger order period. But in the case of two months (which still divides evenly into one year), the answer may be surprising:
```julia-repl
julia> round(DateTime(2016, 7, 17, 8, 55, 30), Dates.Month(2))
2016-07-01T00:00:00
```
Why round to the first day in July, even though it is month 7 (an odd number)? The key is that months are 1-indexed (the first month is assigned 1), unlike hours, minutes, seconds, and milliseconds (the first of which are assigned 0).


### [Rounding Epoch](#Rounding-Epoch)
This means that rounding a [`DateTime`](#Dates.DateTime) to an even multiple of seconds, minutes, hours, or years (because the ISO 8601 specification includes a year zero) will result in a [`DateTime`](#Dates.DateTime) with an even value in that field, while rounding a [`DateTime`](#Dates.DateTime) to an even multiple of months will result in the months field having an odd value. Because both months and years may contain an irregular number of days, whether rounding to an even number of days will result in an even value in the days field is uncertain.
See the [API reference](#stdlib-dates-api) for additional information on methods exported from the `Dates` module.


## [API reference](#stdlib-dates-api)


### [Dates and Time Types](#Dates-and-Time-Types)
```julia
Period
Year
Quarter
Month
Week
Day
Hour
Minute
Second
Millisecond
Microsecond
Nanosecond
```
`Period` types represent discrete, human representations of time.
```julia
CompoundPeriod
```
A `CompoundPeriod` is useful for expressing time periods that are not a fixed multiple of smaller periods. For example, "a year and a day" is not a fixed number of days, but can be expressed using a `CompoundPeriod`. In fact, a `CompoundPeriod` is automatically generated by addition of different period types, e.g. `Year(1) + Day(1)` produces a `CompoundPeriod` result.
```julia
Instant
```
`Instant` types represent integer-based, machine representations of time as continuous timelines starting from an epoch.
```julia
UTInstant{T}
```
The `UTInstant` represents a machine timeline based on UT time (1 day = one revolution of the earth). The `T` is a `Period` parameter that indicates the resolution or precision of the instant.
```julia
TimeType
```
`TimeType` types wrap `Instant` machine instances to provide human representations of the machine instant. `Time`, `DateTime` and `Date` are subtypes of `TimeType`.
```julia
DateTime
```
`DateTime` represents a point in time according to the proleptic Gregorian calendar. The finest resolution of the time is millisecond (i.e., microseconds or nanoseconds cannot be represented by this type). The type supports fixed-point arithmetic, and thus is prone to underflowing (and overflowing). A notable consequence is rounding when adding a `Microsecond` or a `Nanosecond`:


### [Dates and Time Types](#Dates-and-Time-Types)
```julia-repl
julia> dt = DateTime(2023, 8, 19, 17, 45, 32, 900)
2023-08-19T17:45:32.900

julia> dt + Millisecond(1)
2023-08-19T17:45:32.901

julia> dt + Microsecond(1000) # 1000us == 1ms
2023-08-19T17:45:32.901

julia> dt + Microsecond(999) # 999us rounded to 1000us
2023-08-19T17:45:32.901

julia> dt + Microsecond(1499) # 1499 rounded to 1000us
2023-08-19T17:45:32.901
```
```julia
Date
```
`Date` wraps a `UTInstant{Day}` and interprets it according to the proleptic Gregorian calendar.
```julia
Time
```
`Time` wraps a `Nanosecond` and represents a specific moment in a 24-hour day.
```julia
TimeZone
```
Geographic zone generally based on longitude determining what the time is at a certain location. Some time zones observe daylight savings (eg EST -> EDT). For implementations and more support, see the [`TimeZones.jl`](https://github.com/JuliaTime/TimeZones.jl) package
```julia
UTC
```
`UTC`, or Coordinated Universal Time, is the [`TimeZone`](#Dates.TimeZone) from which all others are measured. It is associated with the time at 0° longitude. It is not adjusted for daylight savings.


### [Dates Functions](#Dates-Functions)
```julia
DateTime(y, [m, d, h, mi, s, ms]) -> DateTime
```
Construct a `DateTime` type by parts. Arguments must be convertible to [`Int64`](../../base/numbers/#Core.Int64).
```julia
DateTime(periods::Period...) -> DateTime
```
Construct a `DateTime` type by `Period` type parts. Arguments may be in any order. DateTime parts not provided will default to the value of `Dates.default(period)`.
```julia
DateTime(f::Function, y[, m, d, h, mi, s]; step=Day(1), limit=10000) -> DateTime
```
Create a `DateTime` through the adjuster API. The starting point will be constructed from the provided `y, m, d...` arguments, and will be adjusted until `f::Function` returns `true`. The step size in adjusting can be provided manually through the `step` keyword. `limit` provides a limit to the max number of iterations the adjustment API will pursue before throwing an error (in the case that `f::Function` is never satisfied).
**Examples**
```julia-repl
julia> DateTime(dt -> second(dt) == 40, 2010, 10, 20, 10; step = Second(1))
2010-10-20T10:00:40

julia> DateTime(dt -> hour(dt) == 20, 2010, 10, 20, 10; step = Hour(1), limit = 5)
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
Stacktrace:
[...]
```
```julia
DateTime(dt::Date) -> DateTime
```
Convert a `Date` to a `DateTime`. The hour, minute, second, and millisecond parts of the new `DateTime` are assumed to be zero.
```julia
DateTime(dt::AbstractString, format::AbstractString; locale="english") -> DateTime
```


### [Dates Functions](#Dates-Functions)
Construct a `DateTime` by parsing the `dt` date time string following the pattern given in the `format` string (see [`DateFormat`](#Dates.DateFormat) for syntax).
This method creates a `DateFormat` object each time it is called. It is recommended that you create a [`DateFormat`](#Dates.DateFormat) object instead and use that as the second argument to avoid performance loss when using the same format repeatedly.
**Examples**
```julia-repl
julia> DateTime("2020-01-01", "yyyy-mm-dd")
2020-01-01T00:00:00

julia> a = ("2020-01-01", "2020-01-02");

julia> [DateTime(d, dateformat"yyyy-mm-dd") for d ∈ a] # preferred
2-element Vector{DateTime}:
 2020-01-01T00:00:00
 2020-01-02T00:00:00
```
```julia
format(dt::TimeType, format::AbstractString; locale="english") -> AbstractString
```
Construct a string by using a `TimeType` object and applying the provided `format`. The following character codes can be used to construct the `format` string:


### [Dates Functions](#Dates-Functions)
| Code | Examples | Comment                                                   |
|:-----|:---------|:----------------------------------------------------------|
| `y`  | 6        | Numeric year with a fixed width                           |
| `Y`  | 1996     | Numeric year with a minimum width                         |
| `m`  | 1, 12    | Numeric month with a minimum width                        |
| `u`  | Jan      | Month name shortened to 3-chars according to the `locale` |
| `U`  | January  | Full month name according to the `locale` keyword         |
| `d`  | 1, 31    | Day of the month with a minimum width                     |
| `H`  | 0, 23    | Hour (24-hour clock) with a minimum width                 |
| `M`  | 0, 59    | Minute with a minimum width                               |
| `S`  | 0, 59    | Second with a minimum width                               |
| `s`  | 000, 500 | Millisecond with a minimum width of 3                     |
| `e`  | Mon, Tue | Abbreviated days of the week                              |
| `E`  | Monday   | Full day of week name                                     |


### [Dates Functions](#Dates-Functions)
The number of sequential code characters indicate the width of the code. A format of `yyyy-mm` specifies that the code `y` should have a width of four while `m` a width of two. Codes that yield numeric digits have an associated mode: fixed-width or minimum-width. The fixed-width mode left-pads the value with zeros when it is shorter than the specified width and truncates the value when longer. Minimum-width mode works the same as fixed-width except that it does not truncate values longer than the width.
When creating a `format` you can use any non-code characters as a separator. For example to generate the string "1996-01-15T00:00:00" you could use `format`: "yyyy-mm-ddTHH:MM:SS". Note that if you need to use a code character as a literal you can use the escape character backslash. The string "1996y01m" can be produced with the format "yyyy\\ymm\\m".
```julia
DateFormat(format::AbstractString, locale="english") -> DateFormat
```
Construct a date formatting object that can be used for parsing date strings or formatting a date object as a string. The following character codes can be used to construct the `format` string:


### [Dates Functions](#Dates-Functions)
| Code       | Matches   | Comment                                                       |
|:-----------|:----------|:--------------------------------------------------------------|
| `Y`        | 1996, 96  | Returns year of 1996, 0096                                    |
| `y`        | 1996, 96  | Same as `Y` on `parse` but discards excess digits on `format` |
| `m`        | 1, 01     | Matches 1 or 2-digit months                                   |
| `u`        | Jan       | Matches abbreviated months according to the `locale` keyword  |
| `U`        | January   | Matches full month names according to the `locale` keyword    |
| `d`        | 1, 01     | Matches 1 or 2-digit days                                     |
| `H`        | 00        | Matches hours (24-hour clock)                                 |
| `I`        | 00        | For outputting hours with 12-hour clock                       |
| `M`        | 00        | Matches minutes                                               |
| `S`        | 00        | Matches seconds                                               |
| `s`        | .500      | Matches milliseconds                                          |
| `e`        | Mon, Tues | Matches abbreviated days of the week                          |
| `E`        | Monday    | Matches full name days of the week                            |
| `p`        | AM        | Matches AM/PM (case-insensitive)                              |
| `yyyymmdd` | 19960101  | Matches fixed-width year, month, and day                      |


### [Dates Functions](#Dates-Functions)
Characters not listed above are normally treated as delimiters between date and time slots. For example a `dt` string of "1996-01-15T00:00:00.0" would have a `format` string like "y-m-dTH:M:S.s". If you need to use a code character as a delimiter you can escape it using backslash. The date "1995y01m" would have the format "y\\ym\\m".
Note that 12:00AM corresponds 00:00 (midnight), and 12:00PM corresponds to 12:00 (noon). When parsing a time with a `p` specifier, any hour (either `H` or `I`) is interpreted as as a 12-hour clock, so the `I` code is mainly useful for output.
Creating a DateFormat object is expensive. Whenever possible, create it once and use it many times or try the [`dateformat""`](#Dates.@dateformat_str) string macro. Using this macro creates the DateFormat object once at macro expansion time and reuses it later. There are also several [pre-defined formatters](#Common-Date-Formatters), listed later.
See [`DateTime`](#Dates.DateTime) and [`format`](#Dates.format-Tuple%7BTimeType,%20AbstractString%7D) for how to use a DateFormat object to parse and write Date strings respectively.
```julia
dateformat"Y-m-d H:M:S"
```
Create a [`DateFormat`](#Dates.DateFormat) object. Similar to `DateFormat("Y-m-d H:M:S")` but creates the DateFormat object once during macro expansion.
See [`DateFormat`](#Dates.DateFormat) for details about format specifiers.
```julia
DateTime(dt::AbstractString, df::DateFormat=ISODateTimeFormat) -> DateTime
```


### [Dates Functions](#Dates-Functions)
Construct a `DateTime` by parsing the `dt` date time string following the pattern given in the [`DateFormat`](#Dates.DateFormat) object, or dateformat"yyyy-mm-dd\\THH:MM:SS.s" if omitted.
Similar to `DateTime(::AbstractString, ::AbstractString)` but more efficient when repeatedly parsing similarly formatted date time strings with a pre-created `DateFormat` object.
```julia
Date(y, [m, d]) -> Date
```
Construct a `Date` type by parts. Arguments must be convertible to [`Int64`](../../base/numbers/#Core.Int64).
```julia
Date(period::Period...) -> Date
```
Construct a `Date` type by `Period` type parts. Arguments may be in any order. `Date` parts not provided will default to the value of `Dates.default(period)`.
```julia
Date(f::Function, y[, m, d]; step=Day(1), limit=10000) -> Date
```
Create a `Date` through the adjuster API. The starting point will be constructed from the provided `y, m, d` arguments, and will be adjusted until `f::Function` returns `true`. The step size in adjusting can be provided manually through the `step` keyword. `limit` provides a limit to the max number of iterations the adjustment API will pursue before throwing an error (given that `f::Function` is never satisfied).
**Examples**
```julia-repl
julia> Date(date -> week(date) == 20, 2010, 01, 01)
2010-05-17

julia> Date(date -> year(date) == 2010, 2000, 01, 01)
2010-01-01

julia> Date(date -> month(date) == 10, 2000, 01, 01; limit = 5)
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
Stacktrace:
[...]
```
```julia
Date(dt::DateTime) -> Date
```


### [Dates Functions](#Dates-Functions)
Convert a `DateTime` to a `Date`. The hour, minute, second, and millisecond parts of the `DateTime` are truncated, so only the year, month and day parts are used in construction.
```julia
Date(d::AbstractString, format::AbstractString; locale="english") -> Date
```
Construct a `Date` by parsing the `d` date string following the pattern given in the `format` string (see [`DateFormat`](#Dates.DateFormat) for syntax).
This method creates a `DateFormat` object each time it is called. It is recommended that you create a [`DateFormat`](#Dates.DateFormat) object instead and use that as the second argument to avoid performance loss when using the same format repeatedly.
**Examples**
```julia-repl
julia> Date("2020-01-01", "yyyy-mm-dd")
2020-01-01

julia> a = ("2020-01-01", "2020-01-02");

julia> [Date(d, dateformat"yyyy-mm-dd") for d ∈ a] # preferred
2-element Vector{Date}:
 2020-01-01
 2020-01-02
```
```julia
Date(d::AbstractString, df::DateFormat=ISODateFormat) -> Date
```
Construct a `Date` by parsing the `d` date string following the pattern given in the [`DateFormat`](#Dates.DateFormat) object, or dateformat"yyyy-mm-dd" if omitted.
Similar to `Date(::AbstractString, ::AbstractString)` but more efficient when repeatedly parsing similarly formatted date strings with a pre-created `DateFormat` object.
```julia
Time(h, [mi, s, ms, us, ns]) -> Time
```
Construct a `Time` type by parts. Arguments must be convertible to [`Int64`](../../base/numbers/#Core.Int64).
```julia
Time(period::TimePeriod...) -> Time
```


### [Dates Functions](#Dates-Functions)
Construct a `Time` type by `Period` type parts. Arguments may be in any order. `Time` parts not provided will default to the value of `Dates.default(period)`.
```julia
Time(f::Function, h, mi=0; step::Period=Second(1), limit::Int=10000)
Time(f::Function, h, mi, s; step::Period=Millisecond(1), limit::Int=10000)
Time(f::Function, h, mi, s, ms; step::Period=Microsecond(1), limit::Int=10000)
Time(f::Function, h, mi, s, ms, us; step::Period=Nanosecond(1), limit::Int=10000)
```
Create a `Time` through the adjuster API. The starting point will be constructed from the provided `h, mi, s, ms, us` arguments, and will be adjusted until `f::Function` returns `true`. The step size in adjusting can be provided manually through the `step` keyword. `limit` provides a limit to the max number of iterations the adjustment API will pursue before throwing an error (in the case that `f::Function` is never satisfied). Note that the default step will adjust to allow for greater precision for the given arguments; i.e. if hour, minute, and second arguments are provided, the default step will be `Millisecond(1)` instead of `Second(1)`.
**Examples**
```julia-repl
julia> Time(t -> minute(t) == 30, 20)
20:30:00

julia> Time(t -> minute(t) == 0, 20)
20:00:00

julia> Time(t -> hour(t) == 10, 3; limit = 5)
ERROR: ArgumentError: Adjustment limit reached: 5 iterations
Stacktrace:
[...]
```
```julia
Time(dt::DateTime) -> Time
```


### [Dates Functions](#Dates-Functions)
Convert a `DateTime` to a `Time`. The hour, minute, second, and millisecond parts of the `DateTime` are used to create the new `Time`. Microsecond and nanoseconds are zero by default.
```julia
Time(t::AbstractString, format::AbstractString; locale="english") -> Time
```
Construct a `Time` by parsing the `t` time string following the pattern given in the `format` string (see [`DateFormat`](#Dates.DateFormat) for syntax).
This method creates a `DateFormat` object each time it is called. It is recommended that you create a [`DateFormat`](#Dates.DateFormat) object instead and use that as the second argument to avoid performance loss when using the same format repeatedly.
**Examples**
```julia-repl
julia> Time("12:34pm", "HH:MMp")
12:34:00

julia> a = ("12:34pm", "2:34am");

julia> [Time(d, dateformat"HH:MMp") for d ∈ a] # preferred
2-element Vector{Time}:
 12:34:00
 02:34:00
```
```julia
Time(t::AbstractString, df::DateFormat=ISOTimeFormat) -> Time
```
Construct a `Time` by parsing the `t` date time string following the pattern given in the [`DateFormat`](#Dates.DateFormat) object, or dateformat"HH:MM:SS.s" if omitted.
Similar to `Time(::AbstractString, ::AbstractString)` but more efficient when repeatedly parsing similarly formatted time strings with a pre-created `DateFormat` object.
```julia
now() -> DateTime
```
Return a `DateTime` corresponding to the user's system time including the system timezone locale.
```julia
now(::Type{UTC}) -> DateTime
```


### [Dates Functions](#Dates-Functions)
Return a `DateTime` corresponding to the user's system time as UTC/GMT. For other time zones, see the TimeZones.jl package.
**Examples**
```julia
julia> now(UTC)
2023-01-04T10:52:24.864
```
```julia
eps(::Type{DateTime}) -> Millisecond
eps(::Type{Date}) -> Day
eps(::Type{Time}) -> Nanosecond
eps(::TimeType) -> Period
```
Return the smallest unit value supported by the `TimeType`.
**Examples**
```julia-repl
julia> eps(DateTime)
1 millisecond

julia> eps(Date)
1 day

julia> eps(Time)
1 nanosecond
```


#### [Accessor Functions](#Accessor-Functions-2)
```julia
year(dt::TimeType) -> Int64
```
The year of a `Date` or `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
month(dt::TimeType) -> Int64
```
The month of a `Date` or `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
week(dt::TimeType) -> Int64
```
Return the [ISO week date](https://en.wikipedia.org/wiki/ISO_week_date) of a `Date` or `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64). Note that the first week of a year is the week that contains the first Thursday of the year, which can result in dates prior to January 4th being in the last week of the previous year. For example, `week(Date(2005, 1, 1))` is the 53rd week of 2004.
**Examples**
```julia-repl
julia> week(Date(1989, 6, 22))
25

julia> week(Date(2005, 1, 1))
53

julia> week(Date(2004, 12, 31))
53
```
```julia
day(dt::TimeType) -> Int64
```
The day of month of a `Date` or `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
hour(dt::DateTime) -> Int64
```
The hour of day of a `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
hour(t::Time) -> Int64
```
The hour of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
minute(dt::DateTime) -> Int64
```
The minute of a `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
minute(t::Time) -> Int64
```
The minute of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
second(dt::DateTime) -> Int64
```
The second of a `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).


### [Dates Functions](#Dates-Functions)
```julia
second(t::Time) -> Int64
```
The second of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
millisecond(dt::DateTime) -> Int64
```
The millisecond of a `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
millisecond(t::Time) -> Int64
```
The millisecond of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
microsecond(t::Time) -> Int64
```
The microsecond of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
nanosecond(t::Time) -> Int64
```
The nanosecond of a `Time` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
Year(v)
```
Construct a `Year` object with the given `v` value. Input must be losslessly convertible to an [`Int64`](../../base/numbers/#Core.Int64).
```julia
Month(v)
```
Construct a `Month` object with the given `v` value. Input must be losslessly convertible to an [`Int64`](../../base/numbers/#Core.Int64).
```julia
Week(v)
```
Construct a `Week` object with the given `v` value. Input must be losslessly convertible to an [`Int64`](../../base/numbers/#Core.Int64).
```julia
Day(v)
```
Construct a `Day` object with the given `v` value. Input must be losslessly convertible to an [`Int64`](../../base/numbers/#Core.Int64).
```julia
Hour(dt::DateTime) -> Hour
```
The hour part of a DateTime as a `Hour`.
```julia
Minute(dt::DateTime) -> Minute
```
The minute part of a DateTime as a `Minute`.
```julia
Second(dt::DateTime) -> Second
```
The second part of a DateTime as a `Second`.
```julia
Millisecond(dt::DateTime) -> Millisecond
```


### [Dates Functions](#Dates-Functions)
The millisecond part of a DateTime as a `Millisecond`.
```julia
Microsecond(dt::Time) -> Microsecond
```
The microsecond part of a Time as a `Microsecond`.
```julia
Nanosecond(dt::Time) -> Nanosecond
```
The nanosecond part of a Time as a `Nanosecond`.
```julia
yearmonth(dt::TimeType) -> (Int64, Int64)
```
Simultaneously return the year and month parts of a `Date` or `DateTime`.
```julia
monthday(dt::TimeType) -> (Int64, Int64)
```
Simultaneously return the month and day parts of a `Date` or `DateTime`.
```julia
yearmonthday(dt::TimeType) -> (Int64, Int64, Int64)
```
Simultaneously return the year, month and day parts of a `Date` or `DateTime`.


#### [Query Functions](#Query-Functions-2)
```julia
dayname(dt::TimeType; locale="english") -> String
dayname(day::Integer; locale="english") -> String
```
Return the full day name corresponding to the day of the week of the `Date` or `DateTime` in the given `locale`. Also accepts `Integer`.
**Examples**
```julia-repl
julia> dayname(Date("2000-01-01"))
"Saturday"

julia> dayname(4)
"Thursday"
```
```julia
dayabbr(dt::TimeType; locale="english") -> String
dayabbr(day::Integer; locale="english") -> String
```
Return the abbreviated name corresponding to the day of the week of the `Date` or `DateTime` in the given `locale`. Also accepts `Integer`.
**Examples**
```julia-repl
julia> dayabbr(Date("2000-01-01"))
"Sat"

julia> dayabbr(3)
"Wed"
```
```julia
dayofweek(dt::TimeType) -> Int64
```
Return the day of the week as an [`Int64`](../../base/numbers/#Core.Int64) with `1 = Monday, 2 = Tuesday, etc.`.
**Examples**
```julia-repl
julia> dayofweek(Date("2000-01-01"))
6
```
```julia
dayofmonth(dt::TimeType) -> Int64
```
The day of month of a `Date` or `DateTime` as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
dayofweekofmonth(dt::TimeType) -> Int
```
For the day of week of `dt`, return which number it is in `dt`'s month. So if the day of the week of `dt` is Monday, then `1 = First Monday of the month, 2 = Second Monday of the month, etc.` In the range 1:5.
**Examples**
```julia-repl
julia> dayofweekofmonth(Date("2000-02-01"))
1

julia> dayofweekofmonth(Date("2000-02-08"))
2

julia> dayofweekofmonth(Date("2000-02-15"))
3
```


### [Dates Functions](#Dates-Functions)
```julia
daysofweekinmonth(dt::TimeType) -> Int
```
For the day of week of `dt`, return the total number of that day of the week in `dt`'s month. Returns 4 or 5. Useful in temporal expressions for specifying the last day of a week in a month by including `dayofweekofmonth(dt) == daysofweekinmonth(dt)` in the adjuster function.
**Examples**
```julia-repl
julia> daysofweekinmonth(Date("2005-01-01"))
5

julia> daysofweekinmonth(Date("2005-01-04"))
4
```
```julia
monthname(dt::TimeType; locale="english") -> String
monthname(month::Integer, locale="english") -> String
```
Return the full name of the month of the `Date` or `DateTime` or `Integer` in the given `locale`.
**Examples**
```julia-repl
julia> monthname(Date("2005-01-04"))
"January"

julia> monthname(2)
"February"
```
```julia
monthabbr(dt::TimeType; locale="english") -> String
monthabbr(month::Integer, locale="english") -> String
```
Return the abbreviated month name of the `Date` or `DateTime` or `Integer` in the given `locale`.
**Examples**
```julia-repl
julia> monthabbr(Date("2005-01-04"))
"Jan"

julia> monthabbr(2)
"Feb"
```
```julia
daysinmonth(dt::TimeType) -> Int
```
Return the number of days in the month of `dt`. Value will be 28, 29, 30, or 31.
**Examples**
```julia-repl
julia> daysinmonth(Date("2000-01"))
31

julia> daysinmonth(Date("2001-02"))
28

julia> daysinmonth(Date("2000-02"))
29
```
```julia
isleapyear(dt::TimeType) -> Bool
```
Return `true` if the year of `dt` is a leap year.
**Examples**


### [Dates Functions](#Dates-Functions)
```julia-repl
julia> isleapyear(Date("2004"))
true

julia> isleapyear(Date("2005"))
false
```
```julia
dayofyear(dt::TimeType) -> Int
```
Return the day of the year for `dt` with January 1st being day 1.
```julia
daysinyear(dt::TimeType) -> Int
```
Return 366 if the year of `dt` is a leap year, otherwise return 365.
**Examples**
```julia-repl
julia> daysinyear(1999)
365

julia> daysinyear(2000)
366
```
```julia
quarterofyear(dt::TimeType) -> Int
```
Return the quarter that `dt` resides in. Range of value is 1:4.
```julia
dayofquarter(dt::TimeType) -> Int
```
Return the day of the current quarter of `dt`. Range of value is 1:92.


#### [Adjuster Functions](#Adjuster-Functions-2)
```julia
trunc(dt::TimeType, ::Type{Period}) -> TimeType
```
Truncates the value of `dt` according to the provided `Period` type.
**Examples**
```julia-repl
julia> trunc(DateTime("1996-01-01T12:30:00"), Day)
1996-01-01T00:00:00
```
```julia
firstdayofweek(dt::TimeType) -> TimeType
```
Adjusts `dt` to the Monday of its week.
**Examples**
```julia-repl
julia> firstdayofweek(DateTime("1996-01-05T12:30:00"))
1996-01-01T00:00:00
```
```julia
lastdayofweek(dt::TimeType) -> TimeType
```
Adjusts `dt` to the Sunday of its week.
**Examples**
```julia-repl
julia> lastdayofweek(DateTime("1996-01-05T12:30:00"))
1996-01-07T00:00:00
```
```julia
firstdayofmonth(dt::TimeType) -> TimeType
```
Adjusts `dt` to the first day of its month.
**Examples**
```julia-repl
julia> firstdayofmonth(DateTime("1996-05-20"))
1996-05-01T00:00:00
```
```julia
lastdayofmonth(dt::TimeType) -> TimeType
```
Adjusts `dt` to the last day of its month.
**Examples**
```julia-repl
julia> lastdayofmonth(DateTime("1996-05-20"))
1996-05-31T00:00:00
```
```julia
firstdayofyear(dt::TimeType) -> TimeType
```
Adjusts `dt` to the first day of its year.
**Examples**
```julia-repl
julia> firstdayofyear(DateTime("1996-05-20"))
1996-01-01T00:00:00
```
```julia
lastdayofyear(dt::TimeType) -> TimeType
```
Adjusts `dt` to the last day of its year.
**Examples**
```julia-repl
julia> lastdayofyear(DateTime("1996-05-20"))
1996-12-31T00:00:00
```
```julia
firstdayofquarter(dt::TimeType) -> TimeType
```
Adjusts `dt` to the first day of its quarter.
**Examples**


### [Dates Functions](#Dates-Functions)
```julia-repl
julia> firstdayofquarter(DateTime("1996-05-20"))
1996-04-01T00:00:00

julia> firstdayofquarter(DateTime("1996-08-20"))
1996-07-01T00:00:00
```
```julia
lastdayofquarter(dt::TimeType) -> TimeType
```
Adjusts `dt` to the last day of its quarter.
**Examples**
```julia-repl
julia> lastdayofquarter(DateTime("1996-05-20"))
1996-06-30T00:00:00

julia> lastdayofquarter(DateTime("1996-08-20"))
1996-09-30T00:00:00
```
```julia
tonext(dt::TimeType, dow::Int; same::Bool=false) -> TimeType
```
Adjusts `dt` to the next day of week corresponding to `dow` with `1 = Monday, 2 = Tuesday, etc`. Setting `same=true` allows the current `dt` to be considered as the next `dow`, allowing for no adjustment to occur.
```julia
toprev(dt::TimeType, dow::Int; same::Bool=false) -> TimeType
```
Adjusts `dt` to the previous day of week corresponding to `dow` with `1 = Monday, 2 = Tuesday, etc`. Setting `same=true` allows the current `dt` to be considered as the previous `dow`, allowing for no adjustment to occur.
```julia
tofirst(dt::TimeType, dow::Int; of=Month) -> TimeType
```
Adjusts `dt` to the first `dow` of its month. Alternatively, `of=Year` will adjust to the first `dow` of the year.
```julia
tolast(dt::TimeType, dow::Int; of=Month) -> TimeType
```
Adjusts `dt` to the last `dow` of its month. Alternatively, `of=Year` will adjust to the last `dow` of the year.
```julia
tonext(func::Function, dt::TimeType; step=Day(1), limit=10000, same=false) -> TimeType
```


### [Dates Functions](#Dates-Functions)
Adjusts `dt` by iterating at most `limit` iterations by `step` increments until `func` returns `true`. `func` must take a single `TimeType` argument and return a [`Bool`](../../base/numbers/#Core.Bool). `same` allows `dt` to be considered in satisfying `func`.
```julia
toprev(func::Function, dt::TimeType; step=Day(-1), limit=10000, same=false) -> TimeType
```
Adjusts `dt` by iterating at most `limit` iterations by `step` increments until `func` returns `true`. `func` must take a single `TimeType` argument and return a [`Bool`](../../base/numbers/#Core.Bool). `same` allows `dt` to be considered in satisfying `func`.


#### [Periods](#Periods)
```julia
Year(v)
Quarter(v)
Month(v)
Week(v)
Day(v)
Hour(v)
Minute(v)
Second(v)
Millisecond(v)
Microsecond(v)
Nanosecond(v)
```
Construct a `Period` type with the given `v` value. Input must be losslessly convertible to an [`Int64`](../../base/numbers/#Core.Int64).
```julia
CompoundPeriod(periods) -> CompoundPeriod
```
Construct a `CompoundPeriod` from a `Vector` of `Period`s. All `Period`s of the same type will be added together.
**Examples**
```julia-repl
julia> Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13))
25 hours

julia> Dates.CompoundPeriod(Dates.Hour(-1), Dates.Minute(1))
-1 hour, 1 minute

julia> Dates.CompoundPeriod(Dates.Month(1), Dates.Week(-2))
1 month, -2 weeks

julia> Dates.CompoundPeriod(Dates.Minute(50000))
50000 minutes
```
```julia
canonicalize(::CompoundPeriod) -> CompoundPeriod
```
Reduces the `CompoundPeriod` into its canonical form by applying the following rules:
-   Any `Period` large enough be partially representable by a coarser `Period` will be broken into multiple `Period`s (eg. `Hour(30)` becomes `Day(1) + Hour(6)`)
-   `Period`s with opposite signs will be combined when possible (eg. `Hour(1) - Day(1)` becomes `-Hour(23)`)
**Examples**


### [Dates Functions](#Dates-Functions)
```julia-repl
julia> canonicalize(Dates.CompoundPeriod(Dates.Hour(12), Dates.Hour(13)))
1 day, 1 hour

julia> canonicalize(Dates.CompoundPeriod(Dates.Hour(-1), Dates.Minute(1)))
-59 minutes

julia> canonicalize(Dates.CompoundPeriod(Dates.Month(1), Dates.Week(-2)))
1 month, -2 weeks

julia> canonicalize(Dates.CompoundPeriod(Dates.Minute(50000)))
4 weeks, 6 days, 17 hours, 20 minutes
```
```julia
Dates.value(x::Period) -> Int64
```
For a given period, return the value associated with that period. For example, `value(Millisecond(10))` returns 10 as an integer.
```julia
default(p::Period) -> Period
```
Return a sensible "default" value for the input Period by returning `T(1)` for Year, Month, and Day, and `T(0)` for Hour, Minute, Second, and Millisecond.
```julia
Dates.periods(::CompoundPeriod) -> Vector{Period}
```
Return the `Vector` of `Period`s that comprise the given `CompoundPeriod`.
This function requires Julia 1.7 or later.


#### [Rounding Functions](#Rounding-Functions)
`Date` and `DateTime` values can be rounded to a specified resolution (e.g., 1 month or 15 minutes) with `floor`, `ceil`, or `round`.
```julia
floor(dt::TimeType, p::Period) -> TimeType
```
Return the nearest `Date` or `DateTime` less than or equal to `dt` at resolution `p`.
For convenience, `p` may be a type instead of a value: `floor(dt, Dates.Hour)` is a shortcut for `floor(dt, Dates.Hour(1))`.
```julia-repl
julia> floor(Date(1985, 8, 16), Month)
1985-08-01

julia> floor(DateTime(2013, 2, 13, 0, 31, 20), Minute(15))
2013-02-13T00:30:00

julia> floor(DateTime(2016, 8, 6, 12, 0, 0), Day)
2016-08-06T00:00:00
```
```julia
ceil(dt::TimeType, p::Period) -> TimeType
```
Return the nearest `Date` or `DateTime` greater than or equal to `dt` at resolution `p`.
For convenience, `p` may be a type instead of a value: `ceil(dt, Dates.Hour)` is a shortcut for `ceil(dt, Dates.Hour(1))`.
```julia-repl
julia> ceil(Date(1985, 8, 16), Month)
1985-09-01

julia> ceil(DateTime(2013, 2, 13, 0, 31, 20), Minute(15))
2013-02-13T00:45:00

julia> ceil(DateTime(2016, 8, 6, 12, 0, 0), Day)
2016-08-07T00:00:00
```
```julia
round(dt::TimeType, p::Period, [r::RoundingMode]) -> TimeType
```
Return the `Date` or `DateTime` nearest to `dt` at resolution `p`. By default (`RoundNearestTiesUp`), ties (e.g., rounding 9:30 to the nearest hour) will be rounded up.
For convenience, `p` may be a type instead of a value: `round(dt, Dates.Hour)` is a shortcut for `round(dt, Dates.Hour(1))`.


### [Dates Functions](#Dates-Functions)
```julia-repl
julia> round(Date(1985, 8, 16), Month)
1985-08-01

julia> round(DateTime(2013, 2, 13, 0, 31, 20), Minute(15))
2013-02-13T00:30:00

julia> round(DateTime(2016, 8, 6, 12, 0, 0), Day)
2016-08-07T00:00:00
```
Valid rounding modes for `round(::TimeType, ::Period, ::RoundingMode)` are `RoundNearestTiesUp` (default), `RoundDown` (`floor`), and `RoundUp` (`ceil`).
Most `Period` values can also be rounded to a specified resolution:
```julia
floor(x::Period, precision::T) where T <: Union{TimePeriod, Week, Day} -> T
```
Round `x` down to the nearest multiple of `precision`. If `x` and `precision` are different subtypes of `Period`, the return value will have the same type as `precision`.
For convenience, `precision` may be a type instead of a value: `floor(x, Dates.Hour)` is a shortcut for `floor(x, Dates.Hour(1))`.
```julia-repl
julia> floor(Day(16), Week)
2 weeks

julia> floor(Minute(44), Minute(15))
30 minutes

julia> floor(Hour(36), Day)
1 day
```
Rounding to a `precision` of `Month`s or `Year`s is not supported, as these `Period`s are of inconsistent length.
```julia
ceil(x::Period, precision::T) where T <: Union{TimePeriod, Week, Day} -> T
```
Round `x` up to the nearest multiple of `precision`. If `x` and `precision` are different subtypes of `Period`, the return value will have the same type as `precision`.
For convenience, `precision` may be a type instead of a value: `ceil(x, Dates.Hour)` is a shortcut for `ceil(x, Dates.Hour(1))`.


### [Dates Functions](#Dates-Functions)
```julia-repl
julia> ceil(Day(16), Week)
3 weeks

julia> ceil(Minute(44), Minute(15))
45 minutes

julia> ceil(Hour(36), Day)
2 days
```
Rounding to a `precision` of `Month`s or `Year`s is not supported, as these `Period`s are of inconsistent length.
```julia
round(x::Period, precision::T, [r::RoundingMode]) where T <: Union{TimePeriod, Week, Day} -> T
```
Round `x` to the nearest multiple of `precision`. If `x` and `precision` are different subtypes of `Period`, the return value will have the same type as `precision`. By default (`RoundNearestTiesUp`), ties (e.g., rounding 90 minutes to the nearest hour) will be rounded up.
For convenience, `precision` may be a type instead of a value: `round(x, Dates.Hour)` is a shortcut for `round(x, Dates.Hour(1))`.
```julia-repl
julia> round(Day(16), Week)
2 weeks

julia> round(Minute(44), Minute(15))
45 minutes

julia> round(Hour(36), Day)
2 days
```
Valid rounding modes for `round(::Period, ::T, ::RoundingMode)` are `RoundNearestTiesUp` (default), `RoundDown` (`floor`), and `RoundUp` (`ceil`).
Rounding to a `precision` of `Month`s or `Year`s is not supported, as these `Period`s are of inconsistent length.
The following functions are not exported:
```julia
floorceil(dt::TimeType, p::Period) -> (TimeType, TimeType)
```
Simultaneously return the `floor` and `ceil` of a `Date` or `DateTime` at resolution `p`. More efficient than calling both `floor` and `ceil` individually.
```julia
floorceil(x::Period, precision::T) where T <: Union{TimePeriod, Week, Day} -> (T, T)
```


### [Dates Functions](#Dates-Functions)
Simultaneously return the `floor` and `ceil` of `Period` at resolution `p`. More efficient than calling both `floor` and `ceil` individually.
```julia
epochdays2date(days) -> Date
```
Take the number of days since the rounding epoch (`0000-01-01T00:00:00`) and return the corresponding `Date`.
```julia
epochms2datetime(milliseconds) -> DateTime
```
Take the number of milliseconds since the rounding epoch (`0000-01-01T00:00:00`) and return the corresponding `DateTime`.
```julia
date2epochdays(dt::Date) -> Int64
```
Take the given `Date` and return the number of days since the rounding epoch (`0000-01-01T00:00:00`) as an [`Int64`](../../base/numbers/#Core.Int64).
```julia
datetime2epochms(dt::DateTime) -> Int64
```
Take the given `DateTime` and return the number of milliseconds since the rounding epoch (`0000-01-01T00:00:00`) as an [`Int64`](../../base/numbers/#Core.Int64).


#### [Conversion Functions](#Conversion-Functions)
```julia
today() -> Date
```
Return the date portion of `now()`.
```julia
unix2datetime(x) -> DateTime
```
Take the number of seconds since unix epoch `1970-01-01T00:00:00` and convert to the corresponding `DateTime`.
```julia
datetime2unix(dt::DateTime) -> Float64
```
Take the given `DateTime` and return the number of seconds since the unix epoch `1970-01-01T00:00:00` as a [`Float64`](../../base/numbers/#Core.Float64).
```julia
julian2datetime(julian_days) -> DateTime
```
Take the number of Julian calendar days since epoch `-4713-11-24T12:00:00` and return the corresponding `DateTime`.
```julia
datetime2julian(dt::DateTime) -> Float64
```
Take the given `DateTime` and return the number of Julian calendar days since the julian epoch `-4713-11-24T12:00:00` as a [`Float64`](../../base/numbers/#Core.Float64).
```julia
rata2datetime(days) -> DateTime
```
Take the number of Rata Die days since epoch `0000-12-31T00:00:00` and return the corresponding `DateTime`.
```julia
datetime2rata(dt::TimeType) -> Int64
```
Return the number of Rata Die days since epoch from the given `Date` or `DateTime`.


### [Constants](#Constants)
Days of the Week:
| Variable    | Abbr. | Value (Int) |
|:------------|:------|:------------|
| `Monday`    | `Mon` | 1           |
| `Tuesday`   | `Tue` | 2           |
| `Wednesday` | `Wed` | 3           |
| `Thursday`  | `Thu` | 4           |
| `Friday`    | `Fri` | 5           |
| `Saturday`  | `Sat` | 6           |
| `Sunday`    | `Sun` | 7           |
Months of the Year:
| Variable    | Abbr. | Value (Int) |
|:------------|:------|:------------|
| `January`   | `Jan` | 1           |
| `February`  | `Feb` | 2           |
| `March`     | `Mar` | 3           |
| `April`     | `Apr` | 4           |
| `May`       | `May` | 5           |
| `June`      | `Jun` | 6           |
| `July`      | `Jul` | 7           |
| `August`    | `Aug` | 8           |
| `September` | `Sep` | 9           |
| `October`   | `Oct` | 10          |
| `November`  | `Nov` | 11          |
| `December`  | `Dec` | 12          |


#### [Common Date Formatters](#Common-Date-Formatters)
```julia
Dates.ISODateTimeFormat
```
Describes the ISO8601 formatting for a date and time. This is the default value for `Dates.format` of a `DateTime`.
**Examples**
```julia-repl
julia> Dates.format(DateTime(2018, 8, 8, 12, 0, 43, 1), ISODateTimeFormat)
"2018-08-08T12:00:43.001"
```
```julia
Dates.ISODateFormat
```
Describes the ISO8601 formatting for a date. This is the default value for `Dates.format` of a `Date`.
**Examples**
```julia-repl
julia> Dates.format(Date(2018, 8, 8), ISODateFormat)
"2018-08-08"
```
```julia
Dates.ISOTimeFormat
```
Describes the ISO8601 formatting for a time. This is the default value for `Dates.format` of a `Time`.
**Examples**
```julia-repl
julia> Dates.format(Time(12, 0, 43, 1), ISOTimeFormat)
"12:00:43.001"
```
```julia
Dates.RFC1123Format
```
Describes the RFC1123 formatting for a date and time.
**Examples**
```julia-repl
julia> Dates.format(DateTime(2018, 8, 8, 12, 0, 43, 1), RFC1123Format)
"Wed, 08 Aug 2018 12:00:43"
```


### [Constants](#Constants)
-   [1](#citeref-1)The notion of the UT second is actually quite fundamental. There are basically two different notions of time generally accepted, one based on the physical rotation of the earth (one full rotation = 1 day), the other based on the SI second (a fixed, constant value). These are radically different! Think about it, a "UT second", as defined relative to the rotation of the earth, may have a different absolute length depending on the day! Anyway, the fact that [`Date`](#Dates.Date) and [`DateTime`](#Dates.DateTime) are based on UT seconds is a simplifying, yet honest assumption so that things like leap seconds and all their complexity can be avoided. This basis of time is formally called [UT](https://en.wikipedia.org/wiki/Universal_Time) or UT1. Basing types on the UT second basically means that every minute has 60 seconds and every day has 24 hours and leads to more natural calculations when working with calendar dates.
------------------------------------------------------------------------


# Delimited Files · The Julia Language
Source: https://docs.julialang.org/en/v1/stdlib/DelimitedFiles/


# [Delimited Files](#Delimited-Files)
```julia
readdlm(source, delim::AbstractChar, T::Type, eol::AbstractChar; header=false, skipstart=0, skipblanks=true, use_mmap, quotes=true, dims, comments=false, comment_char='#')
```
Read a matrix from the source where each line (separated by `eol`) gives one row, with elements separated by the given delimiter. The source can be a text file, stream or byte array. Memory mapped files can be used by passing the byte array representation of the mapped segment as source.
If `T` is a numeric type, the result is an array of that type, with any non-numeric elements as `NaN` for floating-point types, or zero. Other useful values of `T` include `String`, `AbstractString`, and `Any`.
If `header` is `true`, the first row of data will be read as header and the tuple `(data_cells, header_cells)` is returned instead of only `data_cells`.
Specifying `skipstart` will ignore the corresponding number of initial lines from the input.
If `skipblanks` is `true`, blank lines in the input will be ignored.
If `use_mmap` is `true`, the file specified by `source` is memory mapped for potential speedups if the file is large. Default is `false`. On a Windows filesystem, `use_mmap` should not be set to `true` unless the file is only read once and is also not written to. Some edge cases exist where an OS is Unix-like but the filesystem is Windows-like.