# Interpret a standard date format with SemanticInterpretation?

Posted 2 months ago
364 Views
|
2 Replies
|
0 Total Likes
|
 I find the following a little disappointing: SemanticInterpretation["2019-Feb-17 00:15:06.745140"] which produces: \$Failed Similarly for: Interpreter["DateTime"][["2019-Feb-17 00:15:06.745140"] and Interpreter["Date"]["2019-Feb-17 00:15:06.745140"] Is there a quick way to get Semantic... to recognize the date/time semantics in the string "2019-Feb-17 00:15:06.745140" ?Thanks,Vince
2 Replies
Sort By:
Posted 2 months ago
 Hi Vincent,the decimals of the seconds seem to be the problem. If you cut them off then it works, e.g.: datestring = "2019-Feb-17 00:15:06.745140"; getDateTime[s_String] := SemanticInterpretation[StringTrim[s, "." ~~ __]]; getDateTime[datestring] I do admit that this is not really satisfying, regards -- Henrik
Posted 2 months ago
 I suspected that.Thank you Henrik.
Community posts can be styled and formatted using the Markdown syntax.