December 2013
Beginner to intermediate
286 pages
5h 46m
English
Suppose we are interested in parsing the date column in the example with the stock prices. The entire row looks something like the following:
[|"2013-02-22"; "54.96"; "55.13"; "54.57"; "55.02"; "5087300"; "55.02"|]
We are interested in the first column, with index 0:
lowestVolume.[0];; val it : string = "2013-02-22"
We can make use of the .NET classes for date and time in the System.DateTime namespace:
> let dateTime = System.DateTime.ParseExact(lowestVolume.[0], "yyyy-mm-dd", null);; val dateTime : System.DateTime = 2013-01-22 00:02:00
Now we have a System.DateTime object, which is compatible with C# and the other .NET languages, to work with!
Read now
Unlock full access