How do I handle Date and Time in VB.NET?

Working with Dates is one to think about. Especially if your data needs to be spread accross timezones Also there are different date formats to take in to consideration. VB.NET Has some good Date() Functions, one of which is demonstrated below:

Example

Imports System.Math
Module Module1
Sub Main ()
Dim Dts as Date
Dts =  # 10/15/2001
System.Console.WriteLine(“New Date: & DateAdd(DateInterval.Month, 22, Dts))
End Sub
End Module


The above code adds 22 months to the date we declared in the Program.

Written by Sandeep Mogulla, Webmaster at www.startvbdotnet.com

Index

 
Printer friendly version of the FAQ-VBNET-Dates page


Sponsored links

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
ASP.NET 3.5 Hosting on Windows 2008!
ASP.NET 3.5/2.0 Hosting on Windows 2008 & 2003! AJAX, LINQ, & Silverlight Ready! 3 Mo. Free!!

Advertisement



Free Magazine

Free Magazines
eWeek The essential technology information source for builders of e-business.... subscribe now

Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.