Working with Dates - 13
- Posted: Nov 21, 2011 at 9:26 AM
- 18,366 Views
- 3 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
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.
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.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
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