Click here to Skip to main content
15,915,763 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Resolution Problem Pls Help Pin
MatrixCoder11-Jun-07 18:06
MatrixCoder11-Jun-07 18:06 
AnswerRe: Resolution Problem Pls Help Pin
Christian Graus11-Jun-07 19:50
protectorChristian Graus11-Jun-07 19:50 
QuestionDate Pin
Socheat.Net11-Jun-07 17:24
Socheat.Net11-Jun-07 17:24 
AnswerRe: Date Pin
MatrixCoder11-Jun-07 17:29
MatrixCoder11-Jun-07 17:29 
GeneralRe: Date Pin
Socheat.Net11-Jun-07 17:37
Socheat.Net11-Jun-07 17:37 
GeneralRe: Date Pin
MatrixCoder11-Jun-07 17:39
MatrixCoder11-Jun-07 17:39 
GeneralRe: Date Pin
Socheat.Net11-Jun-07 17:51
Socheat.Net11-Jun-07 17:51 
AnswerRe: Date Pin
Sathesh Sakthivel11-Jun-07 18:08
Sathesh Sakthivel11-Jun-07 18:08 
substituting minutes, seconds, days, or whatever interval you are looking for in the place of 'hours'. Well, in Visual Basic .NET there are two main ways to achieve this result; the DateDiff function or through the TimeSpan structure.

Both of these methods are equally valid, where they overlap in functionality, but each of them has a couple of unique features. Despite their similar functions, the core difference between the two is that DateDiff is a function, so you need to call it every time you need to retrieve a value, whereas TimeSpan is a structure that is created once and then you just work with its various members as needed.

Using DateDiff, you call it with different date interval parameters to retrieve the appropriate value:

Dim D1, D2 As Date
D1 = Date.Now
D2 = 11/9/2007 'DateDiff
Console.WriteLine("DateDiff")
Console.WriteLine()
Console.WriteLine("{0} Days", _DateDiff(DateInterval.Day, D1, D2))
Console.WriteLine("{0} Hours", _DateDiff(DateInterval.Hour, D1, D2))
Console.WriteLine("{0} Minutes", _DateDiff(DateInterval.Minute, D1, D2))
Console.WriteLine("{0} Seconds", _DateDiff(DateInterval.Second, D1, D2))
Console.WriteLine()

Hope this code will Help you.


Regards,

Satips.Rose | [Rose]

GeneralRe: Date Pin
Socheat.Net11-Jun-07 18:34
Socheat.Net11-Jun-07 18:34 
QuestionVS2005...Weird Speed Issue Pin
Polymorpher11-Jun-07 17:02
Polymorpher11-Jun-07 17:02 
AnswerRe: VS2005...Weird Speed Issue Pin
Johan Hakkesteegt12-Jun-07 2:28
Johan Hakkesteegt12-Jun-07 2:28 
GeneralRe: VS2005...Weird Speed Issue Pin
Polymorpher12-Jun-07 6:57
Polymorpher12-Jun-07 6:57 
GeneralRe: VS2005...Weird Speed Issue Pin
Polymorpher13-Jun-07 16:31
Polymorpher13-Jun-07 16:31 
GeneralRe: VS2005...Weird Speed Issue Pin
Johan Hakkesteegt13-Jun-07 20:47
Johan Hakkesteegt13-Jun-07 20:47 
QuestionAdd New Field Pin
Socheat.Net11-Jun-07 17:02
Socheat.Net11-Jun-07 17:02 
AnswerRe: Add New Field Pin
MatrixCoder11-Jun-07 17:13
MatrixCoder11-Jun-07 17:13 
GeneralRe: Add New Field Pin
Socheat.Net11-Jun-07 17:26
Socheat.Net11-Jun-07 17:26 
Questionfor next loop [modified] Pin
RoedRunner11-Jun-07 16:45
RoedRunner11-Jun-07 16:45 
AnswerRe: for next loop Pin
MatrixCoder11-Jun-07 17:10
MatrixCoder11-Jun-07 17:10 
GeneralRe: for next loop Pin
RoedRunner11-Jun-07 17:16
RoedRunner11-Jun-07 17:16 
GeneralRe: for next loop Pin
MatrixCoder11-Jun-07 17:18
MatrixCoder11-Jun-07 17:18 
AnswerRe: for next loop Pin
Tirthadip11-Jun-07 19:10
Tirthadip11-Jun-07 19:10 
GeneralRe: for next loop Pin
Duane in Japan12-Jun-07 21:09
Duane in Japan12-Jun-07 21:09 
AnswerRe: for next loop Pin
Thomas Stockwell12-Jun-07 3:36
professionalThomas Stockwell12-Jun-07 3:36 
QuestionHow to display a new button from Form1 to Form2 Pin
LAPEC11-Jun-07 14:33
LAPEC11-Jun-07 14:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.