Jump to content

Two-digit Year?


Guest solidarity
 Share

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

Link to comment
Share on other sites

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
Link to comment
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...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...