Apoya a Time.now: Únete a nuestro Plan Premium ¡para una experiencia sin anuncios! Apóyanos: ¡Hazte Premium sin anuncios!

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.

Instrucciones paso a paso

  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).

Conviene saber

%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.