Changed date and time method + ISO 8601 format

* moved date and time stuff to a subroutine
* changed to ISO 8601 format