CSharp examples for System:DateTime Hour
Current Time Hours For Java
using System.Runtime.InteropServices; using System;//from www . j a v a2 s. c o m public class Main{ public static long CurrentTimeHoursForJava() { DateTime baseline = new DateTime(1970, 1, 1, 0, 0, 0); TimeSpan ts = new TimeSpan(DateTime.UtcNow.Ticks - baseline.Ticks); return ((long) ts.TotalMilliseconds/3600000L); } }