Java uses the simplest if to determine whether the date is early or late
给我你的怀抱
给我你的怀抱 2017-05-17 10:08:33
0
2
711

The date consists of three int data, namely year, month, day. You cannot use any function, just use the simplest if to judge. Does anyone have any simple method?

Routine: if is nested inside if, if year is equal, determine month, and then determine day
Direct year1000000 month100 day One if can be done

给我你的怀抱
给我你的怀抱

reply all(2)
曾经蜡笔没有小新

Just convert year month day into string, then add them and compare them, just like sorting. Note that month and day must be two digits, and 0 is added for one digit

PHPzhong

If you consider the simplicity of the code, then your method is indeed good, but from a performance perspective, three ifs are much more efficient than multiplication

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template