Retrieve string date and long date from query result

I guess I will format the date in front-end/server-end to resolve my problem

Probably easier indeed.

it does not work when I search for the docs with the field specified.

If you want to go further, may be provide a full recreation script as described in

It will help to better understand what you are doing.
Please, try to keep the example as simple as possible.