def datetime2iso(d):
	"""Convert a datetime object in a datetime string in ISO format.

	Parameters
	----------
	d : datetime
		datetime object

	Returns
	-------
	str
		datetime in ISO format

	Notes
	-----
	Result is rounded to the nearest integer second.
	The ouput uses 'Z' for UTC datetimes.

	"""
	return d.replace(microsecond=0).isoformat().replace('+00:00','Z')