I'm trying to use jsTimezoneDetect to create a variable for my php code below.
<?php
$latest_mysqldate = new DateTime( $row["latest_entry"]);
$latest_mysqldate->setTimezone(new DateTimeZone('America/New_York'));
$latest_mysqldate = $latest_mysqldate->format('M-d-Y h:i a');
?>
When I use the invoke command from the website http://pellepim.bitbucket.org/jstz/ it's not working. I'm using this code on a completely different webpage trying to figure out the java script first then after I figure that out want to try and put the result in a php variable.
var timezone = jstz.determine();
timezone.name();
I tried this code and it works so I know the java script is fine just don't understand how to take that and put that in my php code. Also if you could let me know why the invoke code by itself doesn't work I'd greatly appreciate it.
<blah id="timezoneid">
<script type="text/javascript">
var timezone = document.getElementById('blahid').innerHTML = jstz.determine().name() + "<br/>";
</script>
As always thanks to the community for your help!