Get started with jstimezonedetect CDN

MIT licensed

Python library: Jstimezonedetect identifies timezones from datetime objects.

Tags:
  • time
  • timezone
  • tz
  • date

Stable version

Copied!

How to start using jstimezonedetect CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with jstimezonedetect CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
  <script src="https://cdn.cdnhub.io/jstimezonedetect/1.0.7/jstz.min.js"></script>
  <script>
    $(document).ready(function() {
      // Get the user's timezone
      $.jstz.localize();
      var userTimezone = $.jstz.determine();

      // Display the user's timezone in the console
      console.log('User timezone:', userTimezone.name());

      // Get the current date and time in the user's timezone
      var userDateTime = $.jstz.local(userTimezone).format('Y-m-d H:i:s');
      console.log('Current date and time in user timezone:', userDateTime);
    });
  </script>
</head>
<body>
  <!-- Your HTML content goes here -->
</body>
</html>
Copied!
Copied!

All versions