The one-liner version of Ricard's example:

  clock format [clock scan {04/24/2001 + 5 days}] -format %m/%d/%Y

- Dossy


On 2001.04.24, ricard helene <[EMAIL PROTECTED]> wrote:
> Here is the quick and dirty way I do it in tcl:
>
> convert the properly formatted initial date to seconds
> with 'clock scan'
> convert the interval being added into seconds
> add the two values, use 'clock format' to put that
> value into a date format.
>
> ex.
> [
>         set initialDate '04/24/2001'
>         # i want 5 days added which is 432000 seconds
>         set interval 432000
>         set newDate [clock format [expr [clock scan
> $initialDate] + $interval] -format "%m/%d/%Y"]
> ]
>
> There are some other ways to do it with clock scan and
> relative time -- check the tcl docs...
>
> As you can see, this is in no way 'elegant' or even
> 'good', but has done the job for me.  Hope it helps
> somehow.
>
> Yes, tcl is smart.
>
> --- Prakash Sinha <[EMAIL PROTECTED]> wrote:
> > Is there any function which works to add two dates
> > or add a day to the date?
> > If anybody has any idea, share that with me!!!
> >
> > Prakash
>
>
> =====
> "Are you going to spend the rest of your life selling sugar water, or are you going 
>to come with me and change the world?"
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/

Reply via email to