how to get js date in yyyy-mm-dd format code example Example: javascript format date yyyy-mm-dd let today = new Date() today.toISOString().split('T')[0]