This topic is locked

DatePart - syntax help

9/8/2009 2:49:35 PM
ASPRunnerPro General questions
T
Tim author

Hello,
I am trying to get the current year and apply it to a session variable. Here is the code I tried:
Session("RefYear")=(DatePart("yy",Date))
I get the error:
Invalid procedure call or argument: 'DatePart'
How would I grab the current year?
Thanks,

Tim

Sergey Kornilov admin 9/9/2009

Session("RefYear")= DatePart("yyyy",Date)
More info:

http://www.w3schools.com/VBscript/func_datepart.asp