Possible Duplicate:
How can I get the current date and time in UTC or GMT in Java?
I want to get the current timestamp in GMT; any ideas how to do that?
i managed to get a string in gmt format the problem is that i want to convert this string to equivalent timestamp object i.e same time but as a timestamp object
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
Date date=new Date();
String s=sdf.format(date);
System.out.println("GMT: "+s);
//need to convert the string to equivalent timestamp object