I need to store time_t as a string in a char array.
There are some other questions about converting time_t to string but they are not helpful to me. i want to store the value of time_t in a string not to convert that to human readable format. Please take a look this question before any answer.
struct tm epoch_date;
strptime("2017 Jan 1 23:59:59", "%Y %b %d %T", &epoch_date);
Time_Epoch = timegm(&epoch_date); // Time_Epoch: 1488268396
Current date and time are: 1488268396
If the aim is to store the value of
time_t in a char array, you can use
char strTime; sprintf(strTime,"%d",Time_Epoch);