#!/bin/bash # Test UTC timestamp handling in Display Manager SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" EVENT_FILE="$PROJECT_ROOT/src/current_event.json" echo "๐Ÿ• UTC Timestamp Test for Display Manager" echo "==========================================" echo "" # Get current UTC and local times UTC_NOW=$(date -u '+%Y-%m-%d %H:%M:%S') LOCAL_NOW=$(date '+%Y-%m-%d %H:%M:%S') TIMEZONE=$(date +%Z) UTC_OFFSET=$(date +%z) echo "๐Ÿ“… Current Time Information:" echo " UTC Time: $UTC_NOW" echo " Local Time: $LOCAL_NOW" echo " Timezone: $TIMEZONE (UTC$UTC_OFFSET)" echo "" # Calculate timestamps for testing # Start: 1 minute ago (UTC) START_TIME=$(date -u -d '1 minute ago' '+%Y-%m-%d %H:%M:%S') # End: 10 minutes from now (UTC) END_TIME=$(date -u -d '10 minutes' '+%Y-%m-%d %H:%M:%S') echo "๐Ÿงช Test Scenarios:" echo "" echo "1๏ธโƒฃ Test Active Event (should display NOW)" echo " Create event with:" echo " - Start: $START_TIME UTC (1 minute ago)" echo " - End: $END_TIME UTC (in 10 minutes)" echo "" read -p "Press Enter to create test event..." cat > "$EVENT_FILE" < "$EVENT_FILE" < "$EVENT_FILE" <