Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Import Dates and Times from Text Files

Formatted dates and times (such as '01/01/01' or '12:30:45') are not numeric fields. MATLAB® interprets dates and times in files as text unless you specify that they should be interpreted as date and time information. When reading a text file using textscan or readtable, indicate date and time data using the %D format specifier. Additionally, you can specify a particular date and time format using %{fmt}D, where fmt is the date and time format. For example, the format specifier, %{dd/MMM/yyyy}D, describes the datetime format, day/month/year.

You can use the Import Tool to import formatted dates and times as datetime values. Specify the formats of dates and times, using the drop-down menu for each column. You can select from a predefined date format, or enter a custom format.

See Also

|

More About

Was this topic helpful?