Skip to content

Julia DateTime cannot be written in mat file #158

@pablosaa

Description

@pablosaa

I got the following error by trying to store Julia's DateTime variables into a MAT file, is there any work around for the error described below?

julia> using MAT
julia> using Dates

julia> t = now()
julia> fmat = matopen("test.mat", "w")
MAT.MAT_HDF5.MatlabHDF5File(HDF5 data file: test.mat, true, true, 0, false)

julia> write(fmat, "T", t)
ERROR: This is the write function for CompositeKind, but the input doesn't fit
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] m_write(::MAT.MAT_HDF5.MatlabHDF5File, ::HDF5.HDF5File, ::String, ::DateTime) at /home/user/.julia/packages/MAT/2LFMT/src/MAT_HDF5.jl:529
 [3] write(::MAT.MAT_HDF5.MatlabHDF5File, ::String, ::DateTime) at /home/user/.julia/packages/MAT/2LFMT/src/MAT_HDF5.jl:545
 [4] top-level scope at REPL[291]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions