When you call localtime for IST, it overwrites the result of localtime for GMT.
Use gmtime for GMT to avoid timezone issues. Copy the results of gmtime and localtime into separate struct tm variables to prevent overwriting.
#include <stdio.h>
#include <time.h>
int main() {
time_t gmt, ist;
struct tm gmt_tm, ist_tm; // Separate instances
char sgmt[100], sist[100];
time(&gmt);
ist = gmt + 19800; // IST is 5h 30m ahead
gmt_tm = *gmtime(&gmt); // Copy GMT result
ist_tm = *localtime(&ist); // Copy IST result
strftime(sgmt, sizeof(sgmt), "%A, %d %B %Y, %X", &gmt_tm);
strftime(sist, sizeof(sist), "%A, %d %B %Y, %X", &ist_tm);
printf("Current GMT: %s\n", sgmt);
printf("Current IST: %s\n", sist);
return 0;
}