algorithm - Date string format that sorted lexicographically ascending is chronologically descending? -
Encoding in the form of a string in the format Meditation Let's always use the same number of numbers for each component of the date (year, month and day) to work, if the number is too small then with leading zero This means that the year can be represented by What is a way of encoding calendar dates in the form of asterisk, such as closing the strings sequentially in sequential chronological order? Ideally, anyone would be easy to change between the calendar's date and format If this helps you, you may need this restriction Is: With my solution the main The problem is that it is not clear to humans that YYYY-MM-DD (without separator Or without, like
2014-04-21 ,
2014.04.21 or
20140421 ) has the following attributes:
< Li> Putting trimmed strings in a lysxicographically ascending (treating them as simple string, knowing what they represent) them in the chronological order
2014-04-21 obviously represents <21> April 21, 2014)
YYYY only
99 99 if we want to represent 5 digit years then in my example above Date
02014-04-21 .
Question:
If you do not manage it, you still want to know your solution.
I can come up with:
86-09-11
86-09-11
represents on April 21, 2014 .
Note:
YYYY-MM-DD string in descending order, which is not I'm watching.
2001-01-02 Could. But this does not make any difference: the man reading the format will know what the format is (in this case
YYYY-MM-DD ) so there is no ambiguity.
Comments
Post a Comment