Commit 3fe93f54 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Use 2-digit year for directory name in Tao.file_prefix

parent c92356ac
......@@ -93,13 +93,13 @@ import Dates
file_prefix(dt = Dates.now(Dates.UTC))
yields the prefix used for TAO data files and based on the UTC date `dt`.
The result is a string of the form: `"YYYYmmdd/YYYYmmdd-HHMMSS-"`
The result is a string of the form: `"YYmmdd/YYYYmmdd-HHMMSS-"`
or just `"YYYYmmdd-HHMMSS-"` if keyword `basename` is true.
"""
file_prefix(dt::Dates.DateTime = Dates.now(Dates.UTC); basename::Bool=false) =
Dates.format(dt, (basename ? "YYYYmmdd-HHMMSS-" :
"YYYYmmdd/YYYYmmdd-HHMMSS-"))
Dates.format(dt, (basename ? "yyyymmdd-HHMMSS-" :
"yymmdd/yyyymmdd-HHMMSS-"))
#------------------------------------------------------------------------------
# LAYOUT
......
module TestingTao
using Test, Tao
import Dates
@testset "Utilities" begin
mask = Bool[0 1 1 1 0
......@@ -16,6 +16,11 @@ using Test, Tao
_, xinds = Tao.indexed_layout(inds);
@test xinds == inds
end
dt = Dates.now(Dates.UTC)
prefix = Tao.file_prefix(dt)
@test basename(prefix) == Tao.file_prefix(dt, basename=true)
@test dirname(prefix) == SubString(prefix, 1, 6)
@test dirname(prefix) == SubString(prefix, 10, 15)
end
end # module
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment