Begin Time (BT) & End Time Calculation

When I hover my mouse on a particular annotation of a time-aligned tier, I can see its begin time (BT) and end time (ET). I’d like to know how you calculate it.
I’m using Python to programmatically generate annotations (actually codes related to a controlled vocabulary) and I need this information for decision making.
I read the ELAN Annotation Format (EAF) based on XML. I could gather that that information is determined using the information found in the element TIME_ORDER, but I don’t know how.
Thanks

I’m not sure if I understand the question(s) correctly. ELAN stores time values in milliseconds in the EAF files. When you hover the mouse over an annotation the begin and end time values (stored in memory as milliseconds) are simply formatted as hh:mm:ss.mss strings.
In EAF such annotations are stored as ALIGNABLE_ANNOTATIONs which have TIME_SLOT_REF1 and TIME_SLOT_REF2 attributes for the begin time and end time. The values are references to TIME_SLOT elements in the TIME_ORDER you already mention. So the TIME_VALUE values are values in milliseconds.
Are you planning to generate (new) .eaf files in Python, or do you want to modify existing .eaf files programmatically?