String Conversion to Date

2

I have html form with the following input:

<div class="form-group">
    <label class="col-md-4 control-label" for="textinput">Início:</label>
    <div class="col-md-4">
        <input id="inicioEvento" name="inicioEvento" class="form-control input-md" type="datetime-local">
    </div>
</div>

My problem is to convert the result of formMap.get ("startEvent"), which returns a String and convert it to the Date type, since in the Event class, the start attribute is of type Date, Start).

Q: I'm a beginner.

    
asked by anonymous 22.04.2016 / 00:47

1 answer

0

You can convert a string to a date like this:

new Date('2011-04-11')

For more information: MDN | Date

    
22.04.2016 / 01:06