Unit 1: How a SOC works · Lesson 5 of 5 · 14 min
Time and time zones
Convert user reports, epoch seconds and ISO timestamps to one clock: UTC.
mission
- You are
- The tier 1 analyst building a timeline.
- Situation
- Your logs use three time formats and users report times in local time. Leeds is on British Summer Time (UTC+1) this week. One wrong hour and you blame the wrong event.
- Goal
- Convert every time you meet to UTC.
- Hand in
- The UTC time of a user's report and of the proxy log's credential POST.
Convert a user's report
A user says they opened an invoice around 10:15. date -u -d parses a time and prints it in UTC. TZ="Europe/London" inside the string says the input is London time.
date -u -d 'TZ="Europe/London" 2026-10-20 10:15'
Tue Oct 20 09:15:00 UTC 2026
you should see 09:15 UTC. Search the logs around 09:15, not 10:15.
date- Prints the date and time, or converts between date formats. Built into Linux and macOS.
Read epoch seconds
The proxy log starts each line with seconds since 1 January 1970. @ tells date the number is epoch time.
grep 'POST https://quillon-payroll' proxy/access.log 1792494581.233 388 10.40.10.64 TCP_MISS/302 512 POST https://quillon-payroll.example.net/login bwright HIER_DIRECT/192.0.2.200 text/html date -u -d @1792494581.233 Tue Oct 20 11:09:41 UTC 2026
you should see 11:09:41 UTC. The user would call it 12:09.
grep- Prints the lines of text that match a pattern. Built into Linux and macOS.
Compare the other formats
Cloud logs use ISO 8601 with a Z, which means UTC. Ubuntu's auth.log writes an offset, here +00:00.
jq -r .createdDateTime identity/signins.jsonl | head -n 2 2026-10-20T02:05:07Z 2026-10-20T02:05:10Z head -n 1 linux/auth/build01-auth.log 2026-10-20T00:17:01.513000+00:00 build01 CRON[2131]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0)
jq- Picks fields out of JSON and reshapes it. Install with sudo apt install jq, or brew install jq on a Mac.
head- Prints the first lines of a file or of piped text. Built into Linux and macOS.
Time formats in this lab
| Command | What it does |
|---|---|
1792494581.233 | Epoch seconds: proxy log, Zeek, audit log |
2026-10-20T02:05:07Z | ISO 8601 in UTC: cloud logs, SIEM, EVTX |
2026-10-20T00:17:01.555000+00:00 | ISO 8601 with offset: Ubuntu syslog |
10/20/2026-09:30:44.520000 | Month first: Suricata fast.log |
around 10:15 | Users: local time, approximate |
What a defender takes away
- 1Pick UTC and convert everything to it before you compare.
- 2date -u -d reads local times and epoch seconds.
- 3Write the time zone next to every time in a ticket.
Questions
0 of 2 solved
Answer each one from what you find on your lab machine.