<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123778>123778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
I don't think this test is quite right. But since we don't have any historical practice with negative leap seconds, my reasoning is based on an assumption: the IANA db contains the earliest time after a leap second is fully inserted. I'm basing this on the fact that positive leap seconds are inserted at 11:59:60 PM on 30 June/31 December, but the db contains 12:00:00 AM on 1 July/1 January.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ldionne
</td>
</tr>
</table>
<pre>
I don't think this test is quite right. But since we don't have any historical practice with negative leap seconds, my reasoning is based on an assumption: the IANA db contains the earliest time after a leap second is fully inserted. I'm basing this on the fact that positive leap seconds are inserted at 11:59:60 PM on 30 June/31 December, but the db contains 12:00:00 AM on 1 July/1 January.
For a positive leap second, the `utc_time` when insertion begins is this `sys_time` plus the accumulated offset, because the insertion begins at the time that would otherwise be 12:00:00 AM on the following day. The test is correct for those cases. But negative leap seconds are different. Insertion happens at the time that would otherwise be 11:59:59 PM, i.e., one second earlier, so I think you have to subtract `1s` to get the correct transition time for negative leap seconds.
_Originally posted by @MattStephanson in https://github.com/llvm/llvm-project/pull/90393#discussion_r1585147783_
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsVE2PqzYX_jXO5uhFYAIkCxa57yhSRpr2Su1-dIADuHVs6nM8Ef--MplJ79WdRbvrolkYKZjnPF82MpvJEbWq-qKqpx1GmX1o7WC8c7Tr_LC28N3vAoN3SjcCMhv3e1oZhFjAMPwRjRAEM82SwZcowMb1BDd6fDTjGwG6FWbD4oPp0cISsBeT9hmZwdGEYt4ILOECTL13Ayv9f7iuEAjZO-OmNKxDpgG8A3SAzPG6iPFOlSeQmeBy-ukEQwe9d4LG8fYnYbAmcRVzJcBRKAB-OyjhjtHaFYxjCkJDBhelm2ualuZucr3b0EbskwsosHg2P3AGDPSAARQoClWeqqMqT3UOX18STJnDc3Sk9Lks4Il6unYUktguyjbjWwWFVuUpz7cFTtv3BTxHuyp9LuAZXcSwZip_Uvnpvp590vcZuzQj4as6j9K_Jj9UncNtJvfO2XgHHU1pcEo46VZ1zis_Ni823m3Fvo_XaDHp9OPIJJsE6jEybTt-gMS7vC2HzcKbj3YALzOFm2GCjj7Tu9nurfW3FMaAawa_Jpj3_vU-BOoFRh9AZs8EPTLxvYufFmsLaTDjSIGcZHB5EJ1xWejvMn0kWx3h60tSbzLK0tM7-ujWvX1bvOzh8n6AVh_vp0I8cOwkHYbkdMHJY_Ew0Z3BhzgJ6FKgyY5EKon9VNt3VXj9OZjJOEzdXjynqLoV1D5_QZFfhJYZHfsUPswiC6vypPRZ6fNkZI5d1vur0mdr3z4e_1uC_416Ufq8RGuVPh_z8lgqXQ6G-8hsvHsNRXWoin3THMrXOw_YDW05HMsj7qgtmrLZNwet9W5ux1F3tW6OTVM3FRbNuB-q_VDVh6ZDQsp3ptW5rvJCF0Vd5VpniDUe6053eXU8jDiqfU5XNDZL_DIfpp1hjtQWumyaw85iR5a3q05rRzfY3iqt080X2k1UFydW-9waFv4LRoxYav-7-v7lV98uBtv-4_ZuLeAEdK_JW6v_DAAA__-jrmDT">