Skip to content

Implement GNU awk strftime - #106

Closed
dewolfe wants to merge 1 commit into
elixir-ai-tools:mainfrom
dewolfe:codex/shl-57-awk-strftime
Closed

dewolfe wants to merge 1 commit into
elixir-ai-tools:mainfrom
dewolfe:codex/shl-57-awk-strftime

Conversation

@dewolfe

@dewolfe dewolfe commented Sep 16, 2026

Copy link
Copy Markdown

Summary

This adds GNU awk-compatible strftime() support. It covers the zero- through three-argument forms, the documented defaults, and PROCINFO["strftime"] overrides.

The implementation reuses the existing GNU-style date formatter. This keeps date directives consistent across date and awk.

Changes

  • Format explicit Unix timestamps and use the current time when the timestamp is absent.
  • Support the optional UTC flag and GNU awk's GMT zone label for forced UTC output.
  • Apply awk number coercion to timestamp values and return an empty string for values outside the supported time range.
  • Add focused unit tests and GNU awk-recorded comparison fixtures.
  • Add the change to the unreleased changelog.

Related issue

SHL-57

Testing

  • mix test — 6,818 tests and 2 doctests pass.
  • mix credo — no issues.
  • mix format --check-formatted — pass.
  • mix bash_fixtures.verify awk — the fixture suite is sound.

@dewolfe dewolfe closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant