Jump to content
Sign in to follow this  
Guest solidarity

Two-digit Year?

Recommended Posts

Guest solidarity

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
Helge

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
Nutster

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.