Finding the time difference

Hi,
I have two files A.txt and B.txt. And i have the following attributes in both the files.
<date and time> <a unique id>

For eg:
<2007 May 30 20:29:36:034 GMT> <ID1> in A.txt
<2007 May 30 20:42:36:038 GMT> <ID1> in B.txt

Now, i need to find the time difference alone by retaining the unique ID and i should return the difference in a separate file C.txt.
How i can achieve this?

Please help me out.

thanks in advance.