@andy78
JavaScript uses milliseconds as a timestamp, whereas PHP uses Unix timestamp which is in seconds. So, you need to convert PHP timestamp to JS timestamp. You can multiply PHP timestamp by 1000 to get JS timestamp. For further information, you can refer this post on StackOverflow.