Hi..
I am new on this technology.
I am Building an application using angular 5 and asp .net 5.
I am trying to save current date and time in mysql database from fornt end which is angular. I have taken datepicker in angular html.
when i am sending date and time from datepicker to asp .net controller.
Here while debugging we found that Date is coming correctly but time is mismach.
Here is my Angular Html code,
- <div class="col-md-3 pr-1">
- <div class="form-group ">
- <label>Date Time</label>
- <ejs-datetimepicker id='datepicker' class="form-control" placeholder='Select a date'
- format='dd/MM/yyyy hh:mm a' [min]='minDate' [(ngModel)]="itemToEdit.AppDateTime"
- name="AppDateTime">
- </ejs-datetimepicker>
- </div>
Here is my Angular ts code,
- saveAppointment() {
-
- this.isInProgress = true;
-
- this.appointmentService.SaveAppointment(this.itemToEdit).subscribe(data => {
- this.loadAppointment();
- alert(this.messages['msg_Success']);
-
- this.isInProgress = false;
- });
- }
Here is my Api code,
- public void Post([FromBody]Appointment value)
- {
- _AppointmentRepository.Post(value);
- }
In above code i.e. web api code we are recieving correct date but wrong time.
thank you in advance