Compare Year and Datetime year
I need my year to be less than or equal to current year.
this is the way I set up my Date Time is what I have in my class and I throw this exception but get an error
8 Replies
can't you just do dt.Year?
Iirc
Umm
Not sure
because it's all sent back to the program
error CS0019: Operator '<=' cannot be applied to operands of ty
pe 'int' and 'DateTime'
this is the error code i get
do dt.Year
instead of dt
if(year <= dt.Year)
Ok I'll give it a shot
thank
s
You got it boss, that'll be $5,000. DM me for my Venmo
LMFAO
IT WORKED
YO
Rip
Just started using dates and times
thanks so much boss
LMAOAOAOAO
I was doing research for far too long
fk this
you can inspect classes to find this stuff btw
So highlight DateTime then right click, go to definition
then you can see all of its properties
very useful when working with new things/libraries
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View