Day>today
add>today,1
Let>tomorrow=today+1
message>tomorrow is the %tomorrow%
When I run this script, it convert the date to one digit. How could I keep the date to display 2 digits "07"
thank you
Need help with the date script
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The mathematical operation is converting the value to a number. If you want prefixed zeros you need to format it as a string again. This will do what you want:
See the VBEval line which uses the Right function. We add a 0 to the left of the value and then take only the last two digits. So if tomorrow was 10 or more, we'd still end up with only two digits without the prefixed zero.
Code: Select all
VBSTART
VBEND
Day>today
add>today,1
Let>tomorrow=today+1
VBEval>Right("0" & "%tomorrow%",2),tomorrow
message>tomorrow is the %tomorrow%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?