From: Marc C. <cul...@gm...> - 2024-08-02 02:05:35
|
If it were up to me I would make the time value argument to the clock format command be optional with the default value being the current time in seconds. That would mean that the shortcut command would be: % clock format -format "%Y-%m-%d" which is a shorter shortcut than either the one using "now" or the one using "-now". If it had been up to me long ago I would probably have replaced "-format" by "-pattern", given that the subcommand is named "format". But I am not objecting to using "now". - Marc On Wed, Jul 31, 2024 at 11:32 AM Harald Oehlmann < har...@el...> wrote: > TCL 8.6 clock format and friends have a clock seconds argument. > The value for clock second for the current time may be returned by > [clock seconds]. > > To format the current day/time, the following command may be used: > > % clock format [clock seconds] -format "%Y-%m-%d" > 2024-07-31 > > TIP 688 addes the following shortcut for this for TCL8.7+: > > % clock format -now -format "%Y-%m-%d" > 2024-07-31 > > With ticket https://core.tcl-lang.org/tcl/info/cd257619 > the following form was added: > > % clock format now -format "%Y-%m-%d" > 2024-07-31 > > The rationales for this: > - It is not a positional parameter (what "-" suggests). It is a special > value for a parameter. > - 2 other commands use "now" in 8.6, none "-now" (free format date scan, > Tk event generate) > > The value "-now" still works, but is undocumented and not tested. > > This change was added as an amendment to TIP 688: > > https://core.tcl-lang.org/tips/doc/trunk/tip/688.md > > I invite anybody to speak up now in case of objections. > > Thanks to Sergey, Ashok and Schelte to make this happen! > > Take care, > Harald > _______________________________________________ > Tcl-Core mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-core > |