Sign in to follow this  
Followers 0
Guest solidarity

Two-digit Year?

5 posts in this topic

I'm sorry if this has already been answered before, but here goes.

The macro @YEAR will give you a four-digit year. Is it possible to get a two-digit year?

Thanks,

Stu

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

You mean like, 2004 = 04 ?

Then try this :

$YEAR = StringRight(@YEAR, 2)
MsgBox(64, "", $YEAR)

Good luck !

EDIT : Holy cow, JdeB :D

You mean something like: StringRight(@YEAR,2)

(I became busy when I started to write my post, so it got delayed..) Edited by Helge

Share this post


Link to post
Share on other sites

Perfect!

Thanks,

Stu

Share this post


Link to post
Share on other sites

Another option, to keep it strictly numeric:

$y = Mod(@YEAR, 100)

Take a look at the MOD function in the help file.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0