Avoids producing different build results in different timezones.
Uses UTC with SOURCE_DATE_EPOCH.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
def get_build_time(d):
if d.getVar('SOURCE_DATE_EPOCH') != None:
import datetime
- return " --with-build-date="+ datetime.datetime.fromtimestamp(float(d.getVar('SOURCE_DATE_EPOCH'))).strftime("%Y%m%d")
+ return " --with-build-date="+ datetime.datetime.utcfromtimestamp(float(d.getVar('SOURCE_DATE_EPOCH'))).strftime("%Y%m%d")
return ""
EXTRA_OECONF_append_class-target = "${@get_build_time(d)}"