Im trying to learn the timezone-js I got from here.
I think I followed the instructions on how to get started. I downloaded all the necessary files including the Olson files but Im getting this error when I check my firefox console: Error: Error: Error retrieving "../files/tz/northamerica" zoneinfo files
.
My code is (jtimezone.html
):
<html>
<head>
<script type="text/javascript" src="../javascript/jquery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../javascript/timezone-js/src/date.js"></script>
<script type="text/javascript">
$(document).ready(function () {
timezoneJS.timezone.zoneFileBasePath = "../files/tz";
timezoneJS.timezone.defaultZoneFile = "asia";
timezoneJS.timezone.init();
var dt = new timezoneJS.Date('10/31/2008', 'America/New_York');
alert(dt);
});
</script>
</head>
<body>
</body>
</html>
I think I have set the file path for the zoneFileBasePath. Anyway my html is located at /home/idiotboy/Documents/timzone_test/html
. The downloaded timezone-js is at /home/idiotboy/Documents/timzone_test/javascript
. The tz
files are at /home/idiotboy/Documents/timzone_test/files
.
Please help. If you can suggest a better/easier way to handle timezones in javascipt please do. Im still a beginner. Thanks.