You have required function in the Java itself.you can use date function.Perhaps date is returned in the millisecond in some function w.e.f 1970.you can divide/multiply it and can get the result.