TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mandar Shinde
NA
423
114.3k
How to pass date and time from angular 5 to asp .net mvc 5
Mar 16 2019 12:52 AM
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
Reply
Answers (
2
)
What is Progressive Web Apps
About Date Format