I am using angular-moment-picker to pick time ( hours and minutes ). I got the time in this format HH:mm as it is shown in my source code below:
<div class="form-group"> <p class="icon-group input-group "> <input readonly ng-model="workTime.startTime" class="form-control"> <span class="input-group-btn "> <button moment-picker="startTime" format="HH:mm" type="button" class="btn btn-default" id="startTime"> <i aria-hidden="true" class="glyphicon glyphicon-calendar"></i> </button> </span> <span class="show-date-picker"></span> </p> </div> After that i formatted it in date format like that:
var startDate=new Date(); var start=$scope.startTime.toString().trim().split(':'); startDate.setHours(start[0]); startDate.setMinutes(start[1]); startDate.setSeconds(0); I got the date in this format:
Mon, 05 Jun 2017 12:00:00 GMT
whenever I store this date in oracle database I got Mon, 05 Jun 2017 11:00:00 GMT
Can someone explain to me why the time is reduced by one hour.
Thank you
javascript date convert gmtwould have given you a handful of answers.