The CreatorCon Call for Content is officially open! Get started here.

I need to convert GMT date/time format into IST format.

niveditakumari
Mega Sage

Hello,

I am getting value of date/time field in GMT format from one API and inserting that value to my table. I need to convert that GMT format into IST then I want to insert that value in my table.

Can anyone please help me with this.

 

Regards,

Nivedita

1 ACCEPTED SOLUTION

Hi, It's bcoz your system timezone is ist. So while storing it is converting to ist. If you don't want that conversion then in our earlier code, Just change this line and uncomment the other lines. Packages.java.util.TimeZone.getTimeZone("IST"); //sets to IST TO Packages.java.util.TimeZone.getTimeZone("GMT"); //sets to GMT and check.

View solution in original post

42 REPLIES 42

share the log output that i sent you in my code.

Hello Asifnoor,

Thank you for your reply.

I have tested and found that in logs i am getting the correct date/time but in table records date/time are different.

 

Regards,

Nivedita

I am getting below log output : 

Start and end dates are 2019-11-12 06:13:44---2019-11-13 06:13:49

Start and end dates are 2018-05-24 07:06:30---2018-05-25 07:06:56

 

Regards,

Nivedita

Hello Asifnoor,

Can you please help me with this.

 

Regards,

Nivedita

Hi, In the logs, you are getting dates from the api. When setting we are converting to IST, hence you see the difference. Don't you want that conversion? Call me once. You can find my number in the profile.