diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py
index 44d645b..3d005ff 100644
--- a/erpnext/controllers/tests/test_recurring_document.py
+++ b/erpnext/controllers/tests/test_recurring_document.py
@@ -5,6 +5,7 @@
 import frappe
 import frappe.permissions
 from erpnext.controllers.recurring_document import date_field_map
+from frappe.utils import getdate
 
 def test_recurring_document(obj, test_records):
 	from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days
@@ -132,19 +133,14 @@
 				obj.assertEquals(base_doc.get(fieldname),
 					new_doc.get(fieldname))
 
-		obj.assertEquals(new_doc.get(date_field), unicode(next_date))
+		obj.assertEquals(new_doc.get(date_field), getdate(next_date))
 
-		obj.assertEquals(new_doc.from_date,
-			unicode(add_months(base_doc.from_date, no_of_months)))
+		obj.assertEquals(new_doc.from_date,	getdate(add_months(base_doc.from_date, no_of_months)))
 
 		if first_and_last_day:
-			obj.assertEquals(new_doc.to_date,
-				unicode(get_last_day(add_months(base_doc.to_date,
-					no_of_months))))
+			obj.assertEquals(new_doc.to_date, getdate(get_last_day(add_months(base_doc.to_date, no_of_months))))
 		else:
-			obj.assertEquals(new_doc.to_date,
-				unicode(add_months(base_doc.to_date, no_of_months)))
-
+			obj.assertEquals(new_doc.to_date, getdate(add_months(base_doc.to_date, no_of_months)))
 
 		return new_doc
 
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py
index 47335f8..d1e39de 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py
@@ -7,7 +7,6 @@
 import frappe
 from erpnext.accounts.utils import validate_fiscal_year
 from frappe import _
-
 from frappe.model.document import Document
 
 class LeaveBlockList(Document):
diff --git a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
index 1f041e4..42b26e3 100644
--- a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
+++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
@@ -5,32 +5,33 @@
 import frappe
 import unittest
 
+from frappe.utils import getdate
 from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
 
 class TestLeaveBlockList(unittest.TestCase):
 	def tearDown(self):
 		 frappe.set_user("Administrator")
-		
+
 	def test_get_applicable_block_dates(self):
 		frappe.set_user("test@example.com")
-		frappe.db.set_value("Department", "_Test Department", "leave_block_list", 
+		frappe.db.set_value("Department", "_Test Department", "leave_block_list",
 			"_Test Leave Block List")
-		self.assertTrue("2013-01-02" in 
+		self.assertTrue(getdate("2013-01-02") in
 			[d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
-			
+
 	def test_get_applicable_block_dates_for_allowed_user(self):
 		frappe.set_user("test1@example.com")
-		frappe.db.set_value("Department", "_Test Department 1", "leave_block_list", 
+		frappe.db.set_value("Department", "_Test Department 1", "leave_block_list",
 			"_Test Leave Block List")
 		self.assertEquals([], [d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
-	
+
 	def test_get_applicable_block_dates_all_lists(self):
 		frappe.set_user("test1@example.com")
-		frappe.db.set_value("Department", "_Test Department 1", "leave_block_list", 
+		frappe.db.set_value("Department", "_Test Department 1", "leave_block_list",
 			"_Test Leave Block List")
-		self.assertTrue("2013-01-02" in 
+		self.assertTrue(getdate("2013-01-02") in
 			[d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03", all_lists=True)])
-		
+
 test_dependencies = ["Employee"]
 
-test_records = frappe.get_test_records('Leave Block List')
\ No newline at end of file
+test_records = frappe.get_test_records('Leave Block List')
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py
index 4cf99a9..bc9b190 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.py
+++ b/erpnext/manufacturing/doctype/workstation/workstation.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import _
-from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds
+from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, get_datetime
 from frappe.model.document import Document
 from dateutil.parser import parse
 
@@ -60,7 +60,7 @@
 	workstation = frappe.get_doc("Workstation", workstation)
 
 	for working_hour in workstation.working_hours:
-		slot_length = (parse(working_hour.end_time) - parse(working_hour.start_time)).total_seconds()
+		slot_length = (get_datetime(working_hour.end_time) - get_datetime(working_hour.start_time)).total_seconds()
 		if slot_length >= operation_length:
 			return
 
@@ -71,7 +71,7 @@
 	if holiday_list and from_datetime and to_datetime:
 		applicable_holidays = []
 		for d in frappe.db.sql("""select holiday_date from `tabHoliday` where parent = %s
-			and holiday_date between %s and %s """, 
+			and holiday_date between %s and %s """,
 			(holiday_list, getdate(from_datetime), getdate(to_datetime))):
 				applicable_holidays.append(formatdate(d[0]))
 
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 388ae63..333be71 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import frappe, unittest
 import frappe.defaults
-from frappe.utils import flt, nowdate, nowtime
+from frappe.utils import flt, nowdate, nowtime, getdate
 from erpnext.stock.doctype.serial_no.serial_no import *
 from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \
 	import set_perpetual_inventory, make_purchase_receipt
@@ -35,8 +35,8 @@
 		frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
 		item_code = "_Test Item 2"
 		warehouse = "_Test Warehouse - _TC"
-		
-		create_stock_reconciliation(item_code="_Test Item 2", warehouse="_Test Warehouse - _TC", 
+
+		create_stock_reconciliation(item_code="_Test Item 2", warehouse="_Test Warehouse - _TC",
 			qty=0, rate=100)
 
 		make_stock_entry(item_code=item_code, target=warehouse, qty=1, incoming_rate=10)
@@ -58,15 +58,15 @@
 		# move stock to positive
 		make_stock_entry(item_code=item_code, target=warehouse, qty=3, incoming_rate=20)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
-		self.assertEqual([[1, 20]], eval(sle.stock_queue))		
-		
+		self.assertEqual([[1, 20]], eval(sle.stock_queue))
+
 		# incoming entry with diff rate
 		make_stock_entry(item_code=item_code, target=warehouse, qty=1, incoming_rate=30)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
 
 		self.assertEqual([[1, 20],[1, 30]], eval(sle.stock_queue))
 
-		frappe.db.set_default("allow_negative_stock", 0)		
+		frappe.db.set_default("allow_negative_stock", 0)
 
 	def test_auto_material_request(self):
 		self._test_auto_material_request("_Test Item")
@@ -83,7 +83,7 @@
 			template = item
 
 		# stock entry reqd for auto-reorder
-		create_stock_reconciliation(item_code=item_code, warehouse="_Test Warehouse - _TC", 
+		create_stock_reconciliation(item_code=item_code, warehouse="_Test Warehouse - _TC",
 			qty=10, rate=100)
 
 		frappe.db.set_value("Stock Settings", None, "auto_indent", 1)
@@ -109,8 +109,8 @@
 
 	def test_material_receipt_gl_entry(self):
 		set_perpetual_inventory()
-		
-		mr = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", 
+
+		mr = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC",
 			qty=50, incoming_rate=100)
 
 		stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse",
@@ -137,9 +137,9 @@
 	def test_material_issue_gl_entry(self):
 		set_perpetual_inventory()
 
-		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", 
+		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC",
 			qty=50, incoming_rate=100)
-		
+
 		mi = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC", qty=40)
 
 		self.check_stock_ledger_entries("Stock Entry", mi.name,
@@ -147,8 +147,8 @@
 
 		stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse",
 			"warehouse": "_Test Warehouse - _TC"})
-			
-		stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry", 
+
+		stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry",
 			"voucher_no": mi.name}, "stock_value_difference"))
 
 		self.check_gl_entries("Stock Entry", mi.name,
@@ -159,7 +159,7 @@
 		)
 
 		mi.cancel()
-		
+
 		self.assertFalse(frappe.db.sql("""select name from `tabStock Ledger Entry`
 			where voucher_type='Stock Entry' and voucher_no=%s""", mi.name))
 
@@ -168,12 +168,12 @@
 
 	def test_material_transfer_gl_entry(self):
 		set_perpetual_inventory()
-		
+
 		create_stock_reconciliation(qty=100, rate=100)
-			
-		mtn = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC", 
+
+		mtn = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC",
 			target="_Test Warehouse 1 - _TC", qty=45)
-			
+
 		self.check_stock_ledger_entries("Stock Entry", mtn.name,
 			[["_Test Item", "_Test Warehouse - _TC", -45.0], ["_Test Item", "_Test Warehouse 1 - _TC", 45.0]])
 
@@ -183,7 +183,7 @@
 		fixed_asset_account = frappe.db.get_value("Account", {"account_type": "Warehouse",
 			"warehouse": mtn.get("items")[0].t_warehouse})
 
-		stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry", 
+		stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry",
 			"voucher_no": mtn.name, "warehouse": "_Test Warehouse - _TC"}, "stock_value_difference"))
 
 		self.check_gl_entries("Stock Entry", mtn.name,
@@ -192,7 +192,7 @@
 				[fixed_asset_account, stock_value_diff, 0.0],
 			])
 		)
-		
+
 		mtn.cancel()
 		self.assertFalse(frappe.db.sql("""select * from `tabStock Ledger Entry`
 			where voucher_type='Stock Entry' and voucher_no=%s""", mtn.name))
@@ -204,7 +204,7 @@
 		set_perpetual_inventory(0)
 
 		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=50, incoming_rate=100)
-		make_stock_entry(item_code="_Test Item Home Desktop 100", target="_Test Warehouse - _TC", 
+		make_stock_entry(item_code="_Test Item Home Desktop 100", target="_Test Warehouse - _TC",
 			qty=50, incoming_rate=100)
 
 		repack = frappe.copy_doc(test_records[3])
@@ -228,7 +228,7 @@
 		set_perpetual_inventory()
 
 		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=50, incoming_rate=100)
-		
+
 		repack = frappe.copy_doc(test_records[3])
 		repack.posting_date = nowdate()
 		repack.posting_time = nowtime()
@@ -238,13 +238,13 @@
 
 		stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse",
 			"warehouse": repack.get("items")[1].t_warehouse})
-			
-		rm_stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry", 
+
+		rm_stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry",
 			"voucher_no": repack.name, "item_code": "_Test Item"}, "stock_value_difference"))
-		
-		fg_stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry", 
+
+		fg_stock_value_diff = abs(frappe.db.get_value("Stock Ledger Entry", {"voucher_type": "Stock Entry",
 			"voucher_no": repack.name, "item_code": "_Test Item Home Desktop 100"}, "stock_value_difference"))
-		
+
 		stock_value_diff = flt(fg_stock_value_diff - rm_stock_value_diff, 2)
 
 		self.check_gl_entries("Stock Entry", repack.name,
@@ -277,7 +277,7 @@
 		gl_entries = frappe.db.sql("""select account, debit, credit
 			from `tabGL Entry` where voucher_type=%s and voucher_no=%s
 			order by account asc, debit asc""", (voucher_type, voucher_no), as_list=1)
-						
+
 		self.assertTrue(gl_entries)
 		gl_entries.sort(key=lambda x: x[0])
 
@@ -291,7 +291,7 @@
 
 		si = create_sales_invoice(item_code=item_code, qty=delivered_qty)
 
-		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=returned_qty, 
+		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=returned_qty,
 			purpose="Sales Return", sales_invoice_no=si.name, do_not_save=True)
 		self.assertRaises(NotUpdateStockError, se.insert)
 
@@ -309,13 +309,13 @@
 		self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1)
 
 		# check if item is validated
-		se = make_stock_entry(item_code="_Test Item Home Desktop 200", target="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item Home Desktop 200", target="_Test Warehouse - _TC",
 			qty=returned_qty, purpose="Sales Return", sales_invoice_no=si.name, do_not_save=True)
 
 		self.assertRaises(frappe.DoesNotExistError, se.insert)
 
 		# try again
-		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC",
 			qty=returned_qty, purpose="Sales Return", sales_invoice_no=si.name)
 
 		# check if available qty is increased
@@ -333,14 +333,14 @@
 
 	def _test_delivery_note_return(self, item_code, delivered_qty, returned_qty):
 		from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
-		
+
 		from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice
-		
+
 		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=50, incoming_rate=100)
 
 		actual_qty_0 = get_qty_after_transaction()
 		# make a delivery note based on this invoice
-		dn = create_delivery_note(item_code="_Test Item", 
+		dn = create_delivery_note(item_code="_Test Item",
 			warehouse="_Test Warehouse - _TC", qty=delivered_qty)
 
 		actual_qty_1 = get_qty_after_transaction()
@@ -352,7 +352,7 @@
 		si.submit()
 
 		# insert and submit stock entry for sales return
-		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC",
 			qty=returned_qty, purpose="Sales Return", delivery_note_no=dn.name)
 
 		actual_qty_2 = get_qty_after_transaction()
@@ -371,7 +371,7 @@
 
 		self.assertEqual(len(jv.get("accounts")), 2)
 		self.assertEqual(jv.get("voucher_type"), "Credit Note")
-		self.assertEqual(jv.get("posting_date"), se.posting_date)
+		self.assertEqual(jv.get("posting_date"), getdate(se.posting_date))
 		self.assertEqual(jv.get("accounts")[0].get("account"), "Debtors - _TC")
 		self.assertEqual(jv.get("accounts")[0].get("party_type"), "Customer")
 		self.assertEqual(jv.get("accounts")[0].get("party"), "_Test Customer")
@@ -402,13 +402,13 @@
 
 	def _test_delivery_note_return_against_sales_order(self, item_code, delivered_qty, returned_qty):
 		from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
-		
+
 		actual_qty_0 = get_qty_after_transaction()
-		
+
 		so = make_sales_order(qty=50)
 
 		dn = create_dn_against_so(so.name, delivered_qty)
-		
+
 		actual_qty_1 = get_qty_after_transaction()
 		self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1)
 
@@ -417,7 +417,7 @@
 		si.submit()
 
 		# insert and submit stock entry for sales return
-		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC",
 			qty=returned_qty, purpose="Sales Return", delivery_note_no=dn.name)
 
 		actual_qty_2 = get_qty_after_transaction()
@@ -451,7 +451,7 @@
 		pi.submit()
 
 		# submit purchase return
-		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC",
 			qty=5, purpose="Purchase Return", purchase_receipt_no=pr.name)
 
 		actual_qty_2 = get_qty_after_transaction()
@@ -466,9 +466,9 @@
 		# out of 10, 5 gets returned
 		prev_se, pr_docname = self.test_purchase_receipt_return()
 
-		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC",
 			qty=6, purpose="Purchase Return", purchase_receipt_no=pr_docname, do_not_save=True)
-		
+
 		self.assertRaises(StockOverReturnError, se.insert)
 
 	def _test_purchase_return_jv(self, se):
@@ -476,7 +476,7 @@
 
 		self.assertEqual(len(jv.get("accounts")), 2)
 		self.assertEqual(jv.get("voucher_type"), "Debit Note")
-		self.assertEqual(jv.get("posting_date"), se.posting_date)
+		self.assertEqual(jv.get("posting_date"), getdate(se.posting_date))
 		self.assertEqual(jv.get("accounts")[0].get("account"), "_Test Payable - _TC")
 		self.assertEqual(jv.get("accounts")[0].get("party"), "_Test Supplier")
 		self.assertEqual(jv.get("accounts")[1].get("account"), "_Test Account Cost for Goods Sold - _TC")
@@ -536,7 +536,7 @@
 		pi.submit()
 
 		# submit purchase return
-		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC", 
+		se = make_stock_entry(item_code="_Test Item", source="_Test Warehouse - _TC",
 			qty=5, purpose="Purchase Return", purchase_receipt_no=pr.name)
 
 		actual_qty_2 = get_qty_after_transaction()
@@ -780,11 +780,11 @@
 		for d in stock_entry.get("items"):
 			if d.s_warehouse:
 				rm_cost += flt(d.amount)
-								
+
 		fg_cost = filter(lambda x: x.item_code=="_Test FG Item 2", stock_entry.get("items"))[0].amount
-		
+
 		self.assertEqual(fg_cost, rm_cost + bom_operation_cost + stock_entry.additional_operating_cost)
-		
+
 
 	def test_variant_production_order(self):
 		bom_no = frappe.db.get_value("BOM", {"item": "_Test Variant Item",
@@ -825,14 +825,14 @@
 
 def make_stock_entry(**args):
 	from erpnext.accounts.utils import get_fiscal_year
-	
+
 	s = frappe.new_doc("Stock Entry")
 	args = frappe._dict(args)
 	if args.posting_date:
 		s.posting_date = args.posting_date
 	if args.posting_time:
 		s.posting_time = args.posting_time
-	
+
 	if not args.purpose:
 		if args.source and args.target:
 			s.purpose = "Material Transfer"
@@ -842,14 +842,14 @@
 			s.purpose = "Material Receipt"
 	else:
 		s.purpose = args.purpose
-		
+
 	s.company = args.company or "_Test Company"
 	s.fiscal_year = get_fiscal_year(s.posting_date)[0]
 	s.purchase_receipt_no = args.purchase_receipt_no
 	s.delivery_note_no = args.delivery_note_no
 	s.sales_invoice_no = args.sales_invoice_no
 	s.difference_account = args.difference_account or "Stock Adjustment - _TC"
-	
+
 	s.append("items", {
 		"item_code": args.item or args.item_code or "_Test Item",
 		"s_warehouse": args.from_warehouse or args.source,
@@ -860,23 +860,23 @@
 		"conversion_factor": 1.0,
 		"cost_center": "_Test Cost Center - _TC"
 	})
-	
+
 	if not args.do_not_save:
 		s.insert()
 		if not args.do_not_submit:
 			s.submit()
 	return s
-	
+
 def get_qty_after_transaction(**args):
 	args = frappe._dict(args)
-	
+
 	last_sle = get_previous_sle({
 		"item_code": args.item_code or "_Test Item",
 		"warehouse": args.warehouse or "_Test Warehouse - _TC",
 		"posting_date": args.posting_date or nowdate(),
 		"posting_time": args.posting_time or nowtime()
 	})
-	
+
 	return flt(last_sle.get("qty_after_transaction"))
 
 test_records = frappe.get_test_records('Stock Entry')
