I'm lazy, I know (hey, at least the next time I do this google, I will find the answer)
Do you have an existing code snippet that takes a Date object and generates a string that has a sort order equivalent to chronological order?
I want the string to contain all parts of the date (day, month, hour, minute, milliseconds, ...) and that when comparing two strings, the string representing the earliest date will be before the string representing the later date.
source share