Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个不同的价值观。一个值(A)是 2020-03-06T10:00:00+05:30,另一个值(B)是 2020-03-03 14:04:02。这两个是 str 格式。现在我必须将这两个不同的值作为日期进行比较。如果“A”大于“B”,我将返回“True”
我厌倦的方法是
if A>B: return True else: return False
正在发生的事情是,如果它更大或更小,它总是只会出现 if 语句。我从不同的来源获得 A 和 B,它的格式与我上面给出的相同。