How can I remove the time with the date of the database in the data retrieval

Javier R 211 Reputation points
2021-05-06T20:20:40.657+00:00

How can I remove the time with the date on a datePicker on sql server c #. Example ddMMYYY 00:00:00

Developer technologies Universal Windows Platform (UWP)
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2021-05-17T17:54:52.263+00:00

    Try this binding:

    <TextBlock Text="{x:Bind DuoDate.ToShortDateString()}" ... 
    
    1 person found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Guoxiong 8,206 Reputation points
    2021-05-06T21:35:24.747+00:00

    Try to use Format function:

    SELECT FORMAT(GETDATE(), 'ddMMyyyy');
    

  2. Yitzhak Khabinsky 26,586 Reputation points
    2021-05-06T21:44:44.31+00:00

    Another way is via CASTing:

     SELECT CAST(GETDATE() AS DATE);
    
    0 comments No comments

  3. Olaf Helper 47,436 Reputation points
    2021-05-07T05:37:27.04+00:00

    on a datePicker on sql server

    There is not DatePicker or any other control on SQL Server side.

    Use DateTime.Date Property to get the date without time potion.

    0 comments No comments

  4. Viorel 122.6K Reputation points
    2021-05-07T07:29:10.847+00:00

    If you never need the time, then use a date column instead of datetime in SQL.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.