How to create a registry and set the current time into registry