There is a typo on the calculated date on Q1:
Code: Select all
z3 is 2024/7/1 14:30:30Zand z4 is 2024/7/1 04:30:30Z.
Thanks!
Moderator: admin
Code: Select all
z3 is 2024/7/1 14:30:30Zand z4 is 2024/7/1 04:30:30Z.
To compare them, you need to translate these times into a common UTC time. Since NYC is 4 hours behind UTC, you have to add 4 to NYC time to get UTC time and since Calcutta is 5:30 hours ahead of UTC, you have to subtract 5:30 to get UTC time. (Note that in terms of "offset" values, the offset for NYC is minus 4 and the offset for Calcutta is plus 5:30). Thus, z3 can be computed as 10:30+4 i.e. 14:30, and so z3 is 2024/7/1 14:30Z and z4 is 2024/7/1 05:00Z (10:30-5:30). Since 14:30 is after 5:00, z3.isAfter(z4) will return true.
Users browsing this forum: Bing [Bot] and 15 guests