diff --git a/src/cell.jl b/src/cell.jl index 20c9866..9e083a5 100644 --- a/src/cell.jl +++ b/src/cell.jl @@ -164,7 +164,7 @@ function _celldata_datetime(v::AbstractString, _is_date_1904::Bool) :: Union{Dat # does not allow empty string @assert !isempty(v) "Cannot convert an empty string into a datetime value." - if occursin(".", v) + if occursin(".", v) || v == "0" time_value = parse(Float64, v) @assert time_value >= 0 diff --git a/test/runtests.jl b/test/runtests.jl index 12cd69c..0f7d402 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1052,7 +1052,7 @@ end data[3] = [101.5, 102.5, missing, 104.5] data[4] = [ true, false, missing, true] data[5] = [ Date(2018, 2, 1), Date(2018, 3, 1), Date(2018,5,20), Date(2018, 6, 2)] - data[6] = [ Dates.Time(19, 10), Dates.Time(19, 20), Dates.Time(19, 30), Dates.Time(19, 40) ] + data[6] = [ Dates.Time(19, 10), Dates.Time(19, 20), Dates.Time(19, 30), Dates.Time(0, 0) ] data[7] = [ Dates.DateTime(2018, 5, 20, 19, 10), Dates.DateTime(2018, 5, 20, 19, 20), Dates.DateTime(2018, 5, 20, 19, 30), Dates.DateTime(2018, 5, 20, 19, 40)] XLSX.writetable("output_table.xlsx", data, col_names, overwrite=true, sheetname="report", anchor_cell="B2")