I am using the import : org.joda.time.DateTime
but while using dateTime, it does not contain DateTime.UtcNow?
DateTime.UtcNow is c# (.Net) :)
For java, you can look at this answer :
How can I get the current date and time in UTC or GMT in Java?
:
SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT")); //Local time zone SimpleDateFormat dateFormatLocal = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); //Time in GMT return dateFormatLocal.parse( dateFormatGmt.format(new Date()) );