This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How can I get the name of the last month?

Help for those learning Tcl or writing their own scripts.
Post Reply
o
oxygen
Voice
Posts: 22
Joined: Mon Sep 05, 2005 2:22 pm
Location: Germany

How can I get the name of the last month?

Post by oxygen »

Hello.

I want to store a file every month in a database, with the name of the previous month.

Code: Select all

file copy -force $file $newfile[strftime %Y]_[expr [strftime %m]-1].db
Any sugestion?

Thnx,
oxygen
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

%B is used to get full month name
t
tsukeh
Voice
Posts: 31
Joined: Thu Jan 20, 2005 6:22 am

Post by tsukeh »

Code: Select all

file copy -force $file $newfile[strftime %Y_%m [clock scan "last month"]].db
o
oxygen
Voice
Posts: 22
Joined: Mon Sep 05, 2005 2:22 pm
Location: Germany

Post by oxygen »

Hello

@DragnLord
Thanks

@tsukeh
Thats exactly what I needed. Thanks a lot. :)

oxygen
Post Reply