Conceptually, let's say you sell a bond three months after the previous coupon date. Because you've sold the bond, you won't receive the next coupon payment, which happens in three months' time. But you deserve half of the next coupon payment, because you've held onto it for half the coupon period. That's what accrued interest is.
Accrued interest, in general, is calculated as
$$\text{AI} = \text{AIF} \times \frac{c}{f}, $$
where AIF is the accrued interest fraction, and $c$ is the annual coupon rate, and $f$ is the coupon frequency.
AIF is simply the day count fraction between the previous coupon date and the settlement date. For US Treasuries, which follows the Actual/Actual convention, it is calculated as
$$\text{AIF} = \frac{\text{settlement date} - \text{previous coupon date}}{\text{next coupon date} - \text{previous coupon date}}.$$
As mentioned, US Treasuries follows $T+1$ settlement convention, which means the settlement date is always the next business day following the trade date. More specifically, if you bought the Treasury today, then it settles tomorrow. (An exception is made for Treasuries trading in the when-issued market, in which case the settlement date is the issue date.)
Accrued interest is zero on all coupon dates. On any other date, it would be non-zero. So if a bond settlement before the first coupon date and after the first interest accrual date, it would have a non-zero AI.
P.S. I think the preference is for you to edit your old question, and we can update the answers accordingly (the questions are so similar...).