1

How do I convert PHP DateTime object to Javascript Date object ?

new Date('06/18/2016') in Javascript = Date {Sat Jun 18 2016 00:00:00 GMT+0800 (SE Asia Standard Time)}

It's easy to get month, just mydate.getMonth() but it didn't work when I try to convert date from PHP

new DateTime('06/18/2016') in PHP = Object { date="2016-06-18 00:00:00", timezone_type=3, timezone="Asia/Kuala_Lumpur"} using mydate.getMonth() didn't work.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.