fixed incorrect datetime usage in templates