I'm trying to convert a string from my database that is formatted as YYYYMMDD and is placed in the input box id="startingdate". How would I convert it to YYYY-MM-DD at the other input box id="startingdate1"?
<input type="" id="startingdate1" name="startingdate1" size="20" class="form-control col-md-7 col-xs-12" placeholder="YYYY-MM-DD"/>
<input id="startingdate" name="startingdate" type="hidden"/>