Parse Unix Timestamps in CI/CD Log Analysis Workflows
Convert Unix timestamps in build logs, deployment records, and API responses to human-readable dates in GitHub Actions. Debug timing issues and measure deployment durations automatically.
The Problem
Your deployment logs contain Unix timestamps like <code>1709800400</code> that are meaningless at a glance. When debugging a production incident, you waste time converting timestamps manually instead of understanding the timeline.
Why This Matters
Timeline reconstruction is the most critical skill in incident response. When your logs show <code>1709800400</code> and your monitoring shows a spike at 10:13 UTC, you need to correlate these instantly. Automated timestamp parsing in your CI pipeline generates human-readable deployment timelines and helps you measure deployment duration, detect time-zone-related bugs, and create audit trails.
Step-by-Step Instructions
Convert timestamps from your logs using the tool below
Paste Unix timestamps from your build or deployment logs into the converter. Identify the time zone offset if your team is distributed — establish a single canonical time zone (UTC) for all CI logs.
Record deployment start and end timestamps
At the start of your deployment job, run echo "deploy_start=$(date +%s)" >> $GITHUB_ENV. At the end, calculate the duration: echo "Duration: $(($(date +%s) - $deploy_start))s".
Convert API timestamps in CI for readable output
When parsing API responses with timestamp fields, use date -d @1709800400 '+%Y-%m-%d %H:%M:%S UTC' (Linux) or date -r 1709800400 '+%Y-%m-%d %H:%M:%S' (macOS) in your workflow steps.
Post deployment timeline to PR comments
Generate a formatted deployment summary with human-readable timestamps and post it as a PR comment using gh pr comment. This creates an audit trail visible in code review.
Try It Now — Unix Timestamp Converter
Open full page →All processing happens in your browser — no data is sent to any server.
Before & After Example
Deployment log: [1709800400] Starting deployment pipeline [1709800423] Building Docker image [1709800891] Pushing to registry (took 468s ??) [1709800912] Deploying to production cluster [1709800945] Health checks passed [1709800950] Deployment complete # What time did this actually happen? # How long did the Docker push take? # Was this during business hours?
name: Deploy with Timeline
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Record deployment start
run: |
START_TS=$(date +%s)
START_HUMAN=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
echo "START_TS=$START_TS" >> $GITHUB_ENV
echo "START_HUMAN=$START_HUMAN" >> $GITHUB_ENV
echo "🚀 Deployment started at $START_HUMAN"
- name: Build and push Docker image
run: |
PUSH_START=$(date +%s)
docker build -t myapp:${{ github.sha }} .
docker push myapp:${{ github.sha }}
PUSH_DURATION=$(($(date +%s) - PUSH_START))
echo "PUSH_DURATION=${PUSH_DURATION}s" >> $GITHUB_ENV
echo "Docker push took ${PUSH_DURATION}s"
- name: Deploy to production
run: kubectl set image deployment/myapp app=myapp:${{ github.sha }}
- name: Generate deployment timeline
if: always()
run: |
END_TS=$(date +%s)
TOTAL=$((END_TS - $START_TS))
END_HUMAN=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
cat > /tmp/timeline.md << EOF
## 📋 Deployment Timeline
| Event | Time (UTC) | Duration |
|-------|-----------|----------|
| Started | $START_HUMAN | — |
| Docker push | — | $PUSH_DURATION |
| Completed | $END_HUMAN | ${TOTAL}s total |
**Commit:** ${{ github.sha }}
**Triggered by:** ${{ github.actor }}
EOF
cat /tmp/timeline.md
- name: Post timeline to PR
if: github.event_name == 'pull_request'
run: gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/timeline.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Frequently Asked Questions
How do I convert Unix timestamps on macOS vs Linux in GitHub Actions?
Linux (Ubuntu runners): date -d @1709800400 '+%Y-%m-%d %H:%M:%S'. macOS runners: date -r 1709800400 '+%Y-%m-%d %H:%M:%S'. For cross-platform: python3 -c "from datetime import datetime, timezone; print(datetime.fromtimestamp(1709800400, tz=timezone.utc))".
Should deployment logs use Unix timestamps or ISO 8601?
ISO 8601 (e.g., 2026-03-10T10:13:20Z) is more human-readable and sorts lexicographically. Unix timestamps are better for arithmetic (duration calculations). Best practice: log both — store Unix timestamp for math, display ISO 8601 for humans.
How do I correlate GitHub Actions timestamps with external monitoring?
GitHub Actions logs use ISO 8601 UTC timestamps. Export your deployment start/end as Unix timestamps and use them as time range boundaries in Datadog, Grafana, or PagerDuty queries to overlay deployment markers on metrics.
Related Workflows
Want the full Unix Timestamp Converter experience?
Open the standalone tool for more space, keyboard shortcuts, and additional features.
Open Unix Timestamp Converter →