How can I get the current month in tcl?


How do I get the current month as an integer, and as a string?

So for this month, I would want "7" and the string "July".

Is there an easy way to do this without a lot of string parsing and a lookup list for month names?

What you need is the clock command.

To get the textual representation of the month, use:

clock format [clock seconds] -format %B

And the numeric representation:

clock format [clock seconds] -format %N