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 Timelabel>
- <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>
- 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,In above code i.e. web api code we are recieving correct date but wrong time.
- public void Post([FromBody]Appointment value)
- {
- _AppointmentRepository.Post(value);
- }
thank you in advance
Puneet KankarPosted Mar 18, 2019, 10:27 PM
Piyush PansuriyaPosted Mar 18, 2019, 8:43 AM