>         set intDate [clock scan "$iDate"] **************** it seems it does not
> like variable iDate. The value coming in iDate is in format 20010426

I don't know what you mean by "it does not like variable iDate".
That is not the error message that tclsh or nsd printed. You'll
generally get more help by telling us precisely what happened than by
anthropomorphizing the computer

>         set showDate [clock format "$intDate" "%a%m%/%d" ]

Yes.  I forgot the -format flag.

    $ tclsh
    % set iDate 20010426
    20010426
    % set intDate [clock scan "$iDate"]
    988261200
    % set showDate [clock format "$intDate" -format "%a%m/%d"]
    Wed04/25

However, that uses a lot of quotes that may end up creating extra
objects in the interpreter, wasting time and memory. This is better
style:

    $ tclsh
    % set iDate 20010426
    20010426
    % set intDate [clock scan $iDate]
    988261200
    % set showDate [clock format $intDate -format "%a%m/%d"]
    Wed04/25

Reply via email to