Date and time data get stored in all sorts of ways. One of the more frustrating issues is that some common GIS formats (Shapefiles) can't store date and time in the same field without making it a string. This is fine for visual display but terrible for use with tools that use DateTime for their functionality, such as the TimeManager Plugin (refer to Chapter 4, Data Exploration).
Use datetime-example.shp
, which contains a variety of date and time representations to play with.
Load
datetime-example.shp
.Open the attribute table of
datetime-example
.Create a new field. As this is a shapefile, we'll need to use a String of length 30 (or you can use the empty field called
calculated
).Turn on layer editing (this is the pencil icon, which is the first icon to the left of the window toolbar).
From the drop-down list, select Calculated.
Now press the Calculation button.