Skip to content

Use explicit format for producing build time

Timo Furrer requested to merge use-explicit-format-build-time into master
  • Use explicit format for producing build time

This change set switched from relying on preformatted date strings to an explicit format. The intention of this is that it works more reliably on various Operating Systems.

Changelog: other

Closes #573 (closed)

Test Protocol

The list below is generated from:

for image in "centos:7" "centos:8" "almalinux:8" "almalinux:9" "debian:10" "debian:11" "debian:12" "opensuse/leap:15.5" "oraclelinux:7" "sl:7" "ubuntu:18.04" "ubuntu:20.04" "ubuntu:22.04" "amazonlinux:2" "amazonlinux"; do
  echo -en "$image:\t\t"
  docker run --platform linux/amd64 -v $(pwd):/app --rm "$image" sh -c 'cd /app && ./build/print_workspace_status.sh' | grep BUILD_TIME
done
centos:7:               BUILD_TIME 2024-05-17T18:46:43Z
centos:8:               BUILD_TIME 2024-05-17T18:46:44Z
almalinux:8:            BUILD_TIME 2024-05-17T18:46:45Z
almalinux:9:            BUILD_TIME 2024-05-17T18:46:45Z
debian:10:              BUILD_TIME 2024-05-17T18:46:46Z
debian:11:              BUILD_TIME 2024-05-17T18:46:46Z
debian:12:              BUILD_TIME 2024-05-17T18:46:47Z
opensuse/leap:15.5:     BUILD_TIME 2024-05-17T18:46:48Z
oraclelinux:7:          BUILD_TIME 2024-05-17T18:46:48Z
sl:7:                   BUILD_TIME 2024-05-17T18:46:49Z
ubuntu:18.04:           BUILD_TIME 2024-05-17T18:46:49Z
ubuntu:20.04:           BUILD_TIME 2024-05-17T18:46:50Z
ubuntu:22.04:           BUILD_TIME 2024-05-17T18:46:51Z
amazonlinux:2:          BUILD_TIME 2024-05-17T18:46:51Z
amazonlinux:            BUILD_TIME 2024-05-17T18:46:52Z

.... Since that uses an explicit format that's kinda expected and the point of it - so no surprise here.

The unit test in place shows this format can be parsed properly.

Edited by Timo Furrer

Merge request reports