Skip to content

Commit

Permalink
Added description of datetime formats. (#2855)
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen authored Jun 26, 2024
2 parents 005c0db + 79e0591 commit a654b0c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/source/data_import_export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,27 @@ Be careful not to press this button unless you want to wipe the whole specificat
When a table is selected, it's data and a preview of how the selected mapping will
import the data will be presented under the options dock widget. An important aspect of data import is
whether each item in the input data should be read as a string, a number,
a time stamp or something else. By default all input data is read as strings.
a time stamp or something else. In other words, the importer should know the data types of the input data.
By default all input data is read as strings.
However, more often than not things like parameter values are actually numbers. Though types are usually casted automatically,
it is possible to manually control what type of data each column (and sometimes each row) contains from the preview table.
Clicking the data type indicator button on column or row headers pops up a menu with a selection of available data types.
Right clicking the column/row header also gives the opportunity to change the data type of all columns/rows at once.

The input data should conform to the specified data type. For float (number) type the decimal separator
should be point. For datetimes such as time stamps the recommended format is ISO8601 (e.g. ``2020-03-01T01:00``).
If non-ISO8601 format is
detected, the importer falls back to the dateutil Python library which supports a lot of different formats.
However, ambiguous formats can be interpreted wrongly. For example, 01-03-2020 is interpreted as January 3, 2020.
If the source file is an Excel file, date cells are interpreted correctly although the way the are shown in
Excel can be ambiguous. For time durations you can use long units in the format ``x unit``, where x is an integer
and unit is either ``year``, ``month``, ``day``, ``hour``, ``minute``, or ``second``. Plural forms of the unit
names can also be used. Alternative is short units
in the format ``xU`` where x is an integer and U is either ``Y`` (for year), ``M`` (for month), ``D`` (for day),
``h`` (for hour), ``m`` (for minute), or ``s`` (for second).
Integer sequence datetimes allow converting integers into datetimes. In this case the user has to specify the
time step and time of the first integer.

.. image:: img/import_editor_column_data_type_menu.png
:align: center

Expand Down

0 comments on commit a654b0c

Please sign in to comment.