โญ Support Time.now: Join our Premium Plan for an ad-free experience! โญ Support Us: Go Premium Ad-Free!

Week numbers in Bash / Shell

To get the current ISO 8601 week number in Bash / Shell, use the following code snippet:

date +%V

* Ensure your system or application regional settings are set to follow ISO 8601 standards (weeks start on Monday) if the output varies.

Step-by-Step Instructions

  1. Open a terminal.
  2. Run: date +%V
  3. The command prints the ISO 8601 week number (01 to 53) for today.
  4. For another date use: date -d "2026-01-01" +%V (GNU date).

Good to Know

%V is the ISO week; %U (Sunday-start) and %W (Monday-start, but week 1 begins Jan 1) are different numbering systems. On macOS/BSD, use date -j -f "%Y-%m-%d" "2026-01-01" +%V for a specific date.