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

Hello,

Thank you for your reply.

If i don't want that conversion, i want to set exact date/time value in my table that i am getting from API that is in GMT only then what should i do.

 

Regards,

Nivedita

Then, use code like this. var Event_start_date = obj.plannedEvents[i].plannedEventStartDate; var Event_end_date = obj.plannedEvents[i].plannedEventEndDate; gr.u_plannedevent_start_date = Event_start_date; gr.u_plannedevent_end_date = Event_end_date; Mark the comment as a correct answer and helpful once worked.

niveditakumari
Mega Sage

Hello,

Can anyone help me with this.

 

Regards,

Nivedita

Check my response to earlier thread. In logs, the date is 06:13 which is GMT. At in ur table it is 11:43 which is ist

Hello,

Can you please help me that how i can set exact date/time that we are getting from API that is in GMT format.

 

Regards,

Nivedita