Solved

VB.net date code

Posted on 2013-06-28
5
266 Views
Last Modified: 2013-06-28
What does this code do?

dtEnd = DateSerial(Year(dtSomething) - 5, Month(dtSomething), Day(dtSomething))
0
Comment
Question by:vbnetcoder
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 39284181
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
 

Author Comment

by:vbnetcoder
ID: 39284186
so basicly it returns the date five years earlier?
0
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 500 total points
ID: 39284200
yes

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

dtEnd would be  28/06/2008
0
 

Author Closing Comment

by:vbnetcoder
ID: 39284227
ty
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 39284264
Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now