Enter your Sign on user name and password.
» Computer Science » Visual Basic » Dates & Times
I. Introduction: Lecture 16 | 14:37 min
In this lesson our instructor talks about Dates & Times
Post by John Snape on July 27, 2014
The date format of #mm/dd/yyyy# is unchangeable mainly because if you hard code a date into your program, it has to be the same whether it is running in the United States or New Zealand or anywhere else. If you put in the date 2/11/1969 and your local date format is yyyy/mm/dd, then it would result in the date being November 1969, of the year 2, consequently throwing an error.Because of this, you must always format your dates in any version of Visual Studio as mm/dd/yyyy. Hope that helps.
Post by David Llewellyn on July 26, 2014
In the code download Ms Aniston's birthday was entered as 2/11/1969 which to a New Zealander, like me, means 2nd Nov '69 as opposed to the American 11th Feb '69. When I ran the code, all the dates output in NZ/British type formats and the calculation of her age in days, confirmed in Excel, gives the correct difference of 16602 days. When I altered the dates to what I would consider to be the correct format i.e. dd/mm/yyyy, Ms Aniston became 16,338 days old (i.e. her birthday was thought to be in November rather than February). Does #aa/bb/cccc# mean specifically US date format and is there some other delimiter for British format.