Assalamualaikum
Well, I saw somewhere that we have to first calculate the no. of hours between maghrib and fajr. Then divide them into 3 parts. The last part will be the time for tahajjud. It's also before fajr.
For eg. Maghrib time is at 7pm and fajr time is at 4am. So the no. of hours between them is 9. We'll now divide it into 3 parts. So 1/3 of night is 7 to 10pm, 2/3 is 10pm to 1am and last third is 1am to 4am. It's always around 3am. Whenever you have confusion, just pray around 3am. Hope it helps.