cancel
Showing results for 
Search instead for 
Did you mean: 

udf to convert into GMT

Former Member
0 Kudos

hi,

(currentDate + udf to convert into GMT ) need to map to Ttime

The Time stamp is in CET. Need to convert into GMT.

can u tell me how to create udf to convert into GMT

thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Similar way ..

java.text.DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); 
df.setCalendar(java.util.Calendar.getInstance(new SimpleTimeZone(0,"GMT")));	
Result.add(df.format(new Date()));

Former Member
0 Kudos

Try with something like this:

import java.util.*;

import java.text.*;

java.text.SimpleDateFormat format = new

SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

java.util.Calendar cal = Calendar.

getInstance(new SimpleTimeZone(0, "GMT"));

format.setCalendar(cal);

java.util.Date date = format.parse("2010-01-01 00:15:30");

Result.add(date.toString());