| View previous topic :: View next topic |
| Author |
Message |
oxygen Voice
Joined: 05 Sep 2005 Posts: 22 Location: Germany
|
Posted: Fri Sep 14, 2007 12:52 pm Post subject: How can I get the name of the last month? |
|
|
Hello.
I want to store a file every month in a database, with the name of the previous month.
| Code: | | file copy -force $file $newfile[strftime %Y]_[expr [strftime %m]-1].db |
Any sugestion?
Thnx,
oxygen |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sat Sep 15, 2007 2:15 am Post subject: |
|
|
| %B is used to get full month name |
|
| Back to top |
|
 |
tsukeh Voice
Joined: 20 Jan 2005 Posts: 31
|
Posted: Sat Sep 15, 2007 3:56 am Post subject: |
|
|
| Code: |
file copy -force $file $newfile[strftime %Y_%m [clock scan "last month"]].db
|
|
|
| Back to top |
|
 |
oxygen Voice
Joined: 05 Sep 2005 Posts: 22 Location: Germany
|
Posted: Sun Sep 16, 2007 1:58 pm Post subject: |
|
|
Hello
@DragnLord
Thanks
@tsukeh
Thats exactly what I needed. Thanks a lot.
oxygen |
|
| Back to top |
|
 |
|