Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Working with Dates - 13

Download

Right click “Save as…”

Dates and times are represented using special types (just like strings are) and deserve some attention. In this lesson we learn how to work with Date and Time data, how to create new instances of Date, how to add time; format the data for display and more. Furthermore, we discuss the TimeSpan class as a means of representing a duration of time.

Download the source code for Working with Dates

Tag:

Follow the Discussion

  • KiethKieth

    A point to note in this lesson; when converting a literal date, it must be in US format or it will either reject it or incorrectly convert it.
    e.g My birthdate is July 20th and I live in Australia. The way it is written in Australia is #20/07/1951# but this will be rejected by the compiler. If however you enter as #07/20/1951# it correctly displays on the screen using local format (20/07/1951).
    I notice that this is also the case when writing dates in an SQL string.

  • @Kieth: Thank you very much for making that point.  Clearly, I'm speaking purely from a USA perspective, and I apologize.  Bad habit when speaking to a global audience!  Again, sincere thanks for adding that note!

  • Bob-I've been working my way through these videos, and I just wanted to take a minute and thank you for putting this series together.  I wouldn't call myself an "absolute beginner" but instead would say that "I know enough about visual basic to be dangerous".  Thanks for the great review!  Also, I wouldn't worry too much about being around 16,000 days old - the number I calculated based on my birth date was about 22,000.  And I don't feel a day over 16,000!

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.