Am trying to convert PHP Timestamp date to a format that can be handled by jquery as a target date for count up timer but i cant find a way around. Here is my code; It only works when i manually edit the target date but when i echo PHP Timestamp then it refuses.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="flipTimer/css/flipTimer.css">
<script src="jquery-3.4.1.min.js"></script>
<script src="flipTimer/js/jquery.flipTimer.js"></script>
</head>
<body>
<div class="flipTimer">
<div class="days"></div>
<div class="hours"></div>
<div class="minutes"></div>
<div class="seconds"></div>
</div>
<script>
var date1="<?php echo $time; ?>";
$(document).ready(function(){
$('.flipTimer').flipTimer({
//count up or count down
direction: 'up',
// the target date that works when i edit manually
date:
'25 July, 2020 07:30:30 ',
//The date format that causes an error
date:
'date1',
});
});
</script>
</body>
</html>