Merge "fix timestamps in images to the build date"
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index c3a0d0b..a6127f8 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -235,8 +235,9 @@
       run_fsck = True
     build_command.extend([in_dir, out_file, fs_type,
                           prop_dict["mount_point"]])
-    if "partition_size" in prop_dict:
-      build_command.append(prop_dict["partition_size"])
+    build_command.append(prop_dict["partition_size"])
+    if "timestamp" in prop_dict:
+      build_command.extend(["-T", str(prop_dict["timestamp"])])
     if "selinux_fc" in prop_dict:
       build_command.append(prop_dict["selinux_fc"])
   else:
@@ -279,7 +280,7 @@
     glob_dict: the global dictionary from the build system.
     mount_point: such as "system", "data" etc.
   """
-  d = {}
+  d = {"timestamp": glob_dict["build.prop"].get("ro.build.date.utc", -1)}
 
   def copy_prop(src_p, dest_p):
     if src_p in glob_dict: