VB.net date code

What does this code do?

dtEnd = DateSerial(Year(dtSomething) - 5, Month(dtSomething), Day(dtSomething))
vbnetcoderAsked:
Who is Participating?
 
Atdhe NuhiuConnect With a Mentor Commented:
yes

so for dtSomething = today (28/06/2013)

dtEnd would be  28/06/2008
0
 
Atdhe NuhiuCommented:
it assigns to dt end a date that is five years prior to the date in dtsomething

It subtracts five from the year portion then reconstitutes the date from the new year value and the same day and month
0
 
vbnetcoderAuthor Commented:
so basicly it returns the date five years earlier?
0
 
vbnetcoderAuthor Commented:
ty
0
 
Atdhe NuhiuCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.