OhDeirdre

Local Time Google Calendar

May 8th, 2026 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | Help | 0 0
  1. <div id="calendar-container"></div>
  2.  
  3. <style>
  4.  
  5. // Source - https://stackoverflow.com/a/32511510
  6. // Posted by sheive, modified by community. See post 'Timeline' for change history
  7. // Retrieved 2026-05-08, License - CC BY-SA 4.0
  8.  
  9. // Instructions
  10. // You must have your calendar set to PUBLIC and ideally, 'See All Event Details' so your viewers can see the names of the time blocks
  11. // Scroll down to 'Integrate Calendar'
  12. // Copy 'Public Url to this Calendar'
  13. // It will look like this 'https://calendar.google.com/calendar/embed?src=_______&ctz=America%2FLos_Angeles'
  14. // The '____' is your Calendar ID, it might be your email or a string of numbers/letters, that is the only part you need
  15.  
  16.  
  17. #calendar-container {
  18. display: flex;
  19. justify-content: center;
  20. align-items: center;
  21. width: 100%;
  22. }
  23.  
  24. iframe {
  25. max-width: 100%;
  26. border: 0;
  27. }
  28. </style>
  29.  
  30. <script type="text/javascript">
  31. const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
  32. const html = `<iframe src="https://calendar.google.com/calendar/embed?mode=week&src=________&ctz=${timezone}" width="1000" height="800" frameborder="0" scrolling="no"></iframe>`;
  33. document.getElementById('calendar-container').innerHTML = html;
  34. </script>
Tags: GCalendar
Advertisement
Add Comment
Please, Sign In to add comment