Abstract current time using function in C#