'mdls' and 'mdimport' interaction: good practice question
I would use stat instead of mdls on a system running the 64bit kernel.

stat -f "%B" file


will return the creation date or birthtime in seconds since epoch (Unix/Epoch time). A human readable output can be produced with

stat -f "%SB" file


You can also format the output of this command by adding the -t option (see man 3 strftime).

On a system running the 32bit kernel, you need to use GetFileInfo.

GetFileInfo -d file


The output from GetFileInfo can be converted to Epoch time by running the output though the date command.

cdate=$(GetFileInfo -d file)
date -j -f "%m/%d/%Y %H:%M:%S" "$cdate" +%s