if dateTimeWycenaPortfelaObliczDataOd is of type DateTime , you can use:
dateTimeWycenaPortfelaObliczDataOd.Date
to get only part of the date (time will be 00:00:00 ...). If you want to get the last tick of the date, you can use:
dateTimeWycenaPortfelaObliczDataOd.Date.AddDays(1).AddTicks(-1)
but you really work better with the next date (.AddDays (1)).
In any case, there is no need to convert to string and back to DateTime.
source share