this is the very basic way on how to use the DATEPART function in vb6,to retrieve
the day,month,year passed to the current date:
CODE:
Print "Days: " & DatePart("d", Now)
Print "Year: " & DatePart("yyyy", Now)
Print "Month: " & DatePart("m", Now)
Print "Quarter: " & DatePart("q", Now)
Print "Weeks: " & DatePart("w", Now)
Print "Hour: " & DatePart("h", Now)
Print "Minutes: " & DatePart("n", Now)
Print "Seconds: " & DatePart("s", Now)
Output:
the output will depends in your current system date,for my case,since my syte my
system date is December 21,2010 19:52:44 PM the output will look like this:
Days: 21
Year: 2010
Month: 12
Quarter: 4
Weeks: 3
Hour: 19
Minutes: 52
Seconds: 44
The Hardest Thing to Do is to Do Nothing
Hope you Like it Happy Coding!!!!
the day,month,year passed to the current date:
CODE:
Print "Days: " & DatePart("d", Now)
Print "Year: " & DatePart("yyyy", Now)
Print "Month: " & DatePart("m", Now)
Print "Quarter: " & DatePart("q", Now)
Print "Weeks: " & DatePart("w", Now)
Print "Hour: " & DatePart("h", Now)
Print "Minutes: " & DatePart("n", Now)
Print "Seconds: " & DatePart("s", Now)
Output:
the output will depends in your current system date,for my case,since my syte my
system date is December 21,2010 19:52:44 PM the output will look like this:
Days: 21
Year: 2010
Month: 12
Quarter: 4
Weeks: 3
Hour: 19
Minutes: 52
Seconds: 44
The Hardest Thing to Do is to Do Nothing
Hope you Like it Happy Coding!!!!
Tags:
VB6 Functions,
Visual Basic 6.0
Leave a comment