get date from javascript datetime yyyy-mm-dd code example Example: js date format yyyy-mm-dd yourDate.toISOString().split('T')[0]