C # - Serialize dates without time


I have a general question. A service from my server has to send dates without time. For example, birthday dates. The question that arises is: if there is no time, I just have to serialize the date as a string. In c # like this:

date.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);

At the beginning I was sending the serialized birth date in Unix Milliseconds and I had problems interpreting the date (the client interpreted me a date 20-04-1932 00:00:00 as 19-04-1932 23:00:00 GMT+01 ).

But why serialize it if I do not want the time? My date of birth is the same in all parts of the world.

Is it correct or am I ignoring something?

asked by MrScf 22.11.2018 в 21:38

0 answers