i need to store createdOn (One Of the Attribute in Domain Class) . i am getting the system time and storing the value for this attribute.. My Time zone is (GMT+5:30 Chennai,
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sf.setTimeZone(TimeZone.getTimeZone("GMT"));
System.out.println(sf.format(new Date()));
SimpleDateFormat sf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sf1.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
System.out.println(sf1.format(new Date()));
System.out.println(Arrays.asList(TimeZone.getDefault()));