There is a build-in function [`DateQ`](http://reference.wolfram.com/mathematica/Calendar/ref/DateQ.html). It is a very nice function. For example it knows that 2000 is a leap year, but 2100 is [not](http://en.wikipedia.org/wiki/Leap_year#Gregorian_calendar) Needs["Calendar`"] DateQ[{2000, 2, 29}] DateQ[{2100, 2, 29}] > True > False Now you can implement `dateTimeQ` dateTimeQ[{h_, m_, d_, hour_, min_, sec_}] := MatchQ[{h, m, d, hour, min, sec}, {__Integer}] && DateQ[{h, m, d}] && 0 <= hour < 24 && 0 <= min < 60 && 0 <= sec < 60; dateTimeQ[___] := False and `convert` convert[quants : {{_?dateTimeQ, _Integer} ..}, prices : {{_?dateTimeQ, _Real} ..}] /; Length@quants == Length@prices := OK; quant = {{{2012, 1, 1, 9, 30, 7}, 150}, {{2012, 1, 1, 9, 30, 12}, 130}, {{2012, 1, 1, 9, 30, 33}, 470}}; price = {{{2012, 1, 1, 9, 30, 7}, 1.50}, {{2012, 1, 1, 9, 30, 33}, 1.30}, {{2012, 1, 1, 9, 30, 33}, 4.70}}; convert[quant, price] > OK