Parse date value for query