Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

VB.net date code

What does this code do?

dtEnd = DateSerial(Year(dtSomething) - 5, Month(dtSomething), Day(dtSomething))
0
vbnetcoder
Asked:
vbnetcoder
  • 3
  • 2
1 Solution
 
Philip PinnellCommented:
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
 
Philip PinnellCommented:
yes

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

dtEnd would be  28/06/2008
0
 
vbnetcoderAuthor Commented:
ty
0
 
Philip PinnellCommented:
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now