Wrong conversion of time_t to char I have a simple sample of code that i want to convent a time_t to char array in order to concatenate it after, in an other array.
Code:

time_t unixt;
char exm [40];


unixt = RTC.get();
Serial.println(unixt);
dtostrf(unixt, 10, 0, exm);
Serial.println(exm);


The problem that i face is that, the console is printing different the second one every time like this: 

1548258220
1548258200


I tried also with unsigned long with no result either. Can someone point me what's wrong or an other way of doing this?
Use ultoa() instead of dtostrf(). The former is meant to serialize
unsigned long integers, while the later is for floating point numbers.
By using dtostrf(), you are implicitly converting unixt to a
floating point number. The Arduino Mega only supports single precision
floating point, so this conversion incurs some loss of precision, hence
the result you see.