angularjs - How to get date and time separtely -
this question has answer here:
- separate date , time 2 answers
i'm beginner of angularjs. need half value input.
this code. i'm using datetime-picker
<input class="form-control" placeholder="choose date , time" name="datetime" value="datetime" ng-model="date3.data" datetime-picker date-format="yyyy-mm-dd hh:mm:ss" close-on-select="false" />
now 2016-06-29 12:14:00
i need separate date , time -like date = 2016-06-20 , time = 12:14:00
just use split
method in string
t = "2016-06-29 12:14:00" var = t.split(" "); var date = a[0]; var time = a[1];
Comments
Post a Comment