How to get 100% identical compressed files, for source files that only differ in creation date?

Create a couple of identical files:

$ echo hello > file1.test
$ echo hello > file2.test

gzip them...

$ gzip file1.test
$ gzip file2.test

observe timestamp field as the only difference:

$ hexdump file1.test.gz

0000000 8b1f 0808 TIME STMP 0300 6966 656c 2e31
0000010 6574 7473 cb00 cd48 c9c9 02e7 2000 3a30
0000020 0636 0000 0000                         

For more info on the timestamp, see the RFC

Now, you can either take an MD5 that starts after byte 8, zero these four bytes in your files and lose their timestamps, or extract the CRC16 from those gzips (also see the RFC for info on how to extract this)

Or, you could save without the timestamp:

$ echo test > file1.test
$ echo test > file2.test
$ gzip -n file1.test
$ gzip -n file2.test
$ md5sum file1.test.gz
cfe4ddf1c4c3891b4ff4a1269b42db82  file1.test.gz
$ md5sum file2.test.gz
cfe4ddf1c4c3891b4ff4a1269b42db82  file2.test.gz

Not a direct answer to your question but it might be of help anyway.

Long time ago (a different millenium) I had the same problem. We wanted to know if compressed files where the same without decompressing them and comparing them.

Our solution was to get a md5sum of the file before compressing it, then we compressed the file and renamed it to md5sum.zip (.zip or .tar.gz or .rar or .whatever). That way we knew that if two files had the same name (without suffix) they where identical.