VB NOTES PART 9

VB NOTES PART 9 - -doesn’t change actual date-have to do the assignment Add 3 hours not equal to hour =3-row over to the next day Can also get

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
2/24 Date is a data type A structure-basically the same as an object Create one by call its constructor method Dim delivery As Date = New Date (2011, 2, 24, 14, 39, 53) New is the name of the constructor method Year month date hour minute second 1-9999 1-12 1-? 0-23 0-59 0-59 Many variations---overloaded constructors (Overloaded----two meanings changing due to the context) 11 of these, with different signatures Delivery is the reference variable Accessing: Dim myYear As Integer=delivery.Year ( consider it as a property) Can all be accessed as integers Modifying: Delivery=delivery.AddHours (3)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ----doesn’t change actual date-have to do the assignment Add 3 hours not equal to hour+=3---row over to the next day Can also get current time: Dim CorrentTime As Date = Date.Now--------shared member accessed through type name Date If we change time zone to Washington-----delivery=delivery.AddHours (-2)-----Many ways to format: • Genera date:12/31/2002 12:00 AM • Long date: Tuesday, December 31, 2002 • Short date: 12/31/2002 • Long time: 3:23:25 PM • Short time: 3:23 PM Delivery.ToLongDateString () Or, use String. Format (“{0:hh.mm.ss TT}”, Date.Now...
View Full Document

This note was uploaded on 12/01/2011 for the course 6K 226 taught by Professor Staff during the Fall '10 term at University of Iowa.

Page1 / 2

VB NOTES PART 9 - -doesn’t change actual date-have to do the assignment Add 3 hours not equal to hour =3-row over to the next day Can also get

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online