Timezone-Aware Exports
Overview
The system provides basic timezone support for exports, automatically detecting the user's browser timezone and converting timestamps accordingly. This ensures that exported data displays times in a format familiar to the user.
How Timezone Detection Works
Automatic Browser Detection
The system uses JavaScript to detect the user's timezone:
const userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// Examples: "America/New_York", "Europe/London", "Asia/Tokyo"
Supported Timezone Formats
The system supports IANA timezone identifiers including:
| Region | Example Timezones |
|---|---|
| Americas | America/New_York, America/Los_Angeles, America/Chicago |
| Europe | Europe/London, Europe/Paris, Europe/Berlin |
| Asia | Asia/Tokyo, Asia/Shanghai, Asia/Kolkata |
| Australia | Australia/Sydney, Australia/Melbourne |
Export Formats with Timezone Support
CSV Exports
Timestamps in CSV files are converted to the user's detected timezone:
Evaluation Date, Teacher Name, Score
2024-01-15 14:30:25 EST, John Smith, 85.5
2024-01-15 19:30:25 GMT, Jane Doe, 92.0
How It Works
- Detection: Browser timezone detected via JavaScript
- Transmission: Timezone sent to server with export request
- Conversion: Server converts UTC timestamps to user timezone
- Display: Exported file shows times in user's local timezone
Supported Export Types
Assessment Exports
- Teacher evaluation reports
- Rubric performance data
- Batch evaluation summaries
- Organization analytics
Student Exports
- Exam results and performance
- Study plan progress
- Assignment submissions
- Analytics reports
Technical Details
Server-Side Processing
The timezone conversion happens on the server using Python's timezone utilities:
# Basic timezone conversion (from actual codebase)
from qbank.utils.timezone_utils import convert_to_local_time
local_time = convert_to_local_time(utc_timestamp, user_timezone)
Export Request Flow
- User clicks export button
- JavaScript detects browser timezone
- Timezone sent as parameter:
?timezone=America/New_York - Server processes export with timezone conversion
- File downloaded with localized timestamps
Limitations
Current System Constraints
- No User Preferences: Timezone is detected per-session, not saved
- No Organization Defaults: No organization-level timezone settings
- Basic Conversion: Simple UTC-to-local conversion only
- Limited Customization: No format preference options
Browser Dependency
- Requires JavaScript enabled
- Depends on browser timezone settings
- May not work with privacy tools that block timezone detection
Troubleshooting
Common Issues
Timezone shows as UTC instead of local time - Check if JavaScript is enabled in browser - Verify browser timezone settings are correct - Try refreshing the page to re-detect timezone
Export times don't match expected timezone - Verify browser's system timezone is set correctly - Check if using VPN that affects timezone detection - Try exporting from different browser or device
Inconsistent time display - Browser timezone settings may have changed - Daylight saving time transitions can cause confusion - Clear browser cache and retry export
Error Messages
"Timezone detection failed" - JavaScript may be disabled - Browser may not support timezone detection - Export will default to UTC time
"Invalid timezone parameter" - Browser sent unsupported timezone identifier - Export will fall back to UTC time - Contact administrator if problem persists
Best Practices
For Users
- Verify Timezone: Check browser timezone settings before exporting
- Consistent Environment: Use same computer/browser for related exports
- Document Timezone: Note which timezone was used for important exports
- Cross-Reference: Compare with other sources if times seem incorrect
For Administrators
- User Training: Educate users about timezone handling
- Documentation: Include timezone information in export file names
- Support: Help users troubleshoot timezone-related issues
- Monitoring: Track timezone-related support requests
Related Documentation
- Advanced Rubric Data Export - Export features with timezone support
- Enhanced Teacher Analytics - Analytics with timezone handling
