You can find 2 main formats on government issued IDs and paper work.
YYYY/MM/DD (example: Ontario driver's licenses)DD/MM/YYYY (example: Canadian Passports*)As someone who grew up in Canada close to the American boarder, for informal dates (school assignments, notes, etc), both DD/MM/YYYY and MM/DD/YYYY would be acceptable.
Converting dates entered as strings into numeric dates in R is simple for a single string, similarly simple for a vector of strings if the date information is represented consistently, and a little trickier if the date information is not represented consistently.
Below, we define strings and vectors of strings for each of these scenarios. Once R formats a string as a “Date” object, it prints the date as “(4-digit year)-(2-digit month)-(2-digit day)”. When looking at a single date string, one can simply identify how month, day, and year are represented in the one instance and use those in the R function as.
Date (probably after looking at the long list of date representations in the strptime help file). Date are the date string and then, in quotations, the format in which the date appears within the string.
It helps cut out the uncertainty and confusion when communicating internationally.
Unfortunately, we have some years that appear as 2 digits and some that appear as 4.
As a result, we can see in our results that the first three dates are correct and the last two are not.
For more information, see the following help topics: Both Microsoft Excel for the Macintosh and Excel for Windows support the 19 date systems.
When there is more than one publication date, use the one that is most relevant to your research. Online versions of articles sometimes display two dates: 1) the date the article was posted online and 2) the date that the printed version was published.