how to make javascript read YYYY-MM-DD string code example Example: js date format yyyy-mm-dd yourDate.toISOString().split('T')[0]