Share via

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

Answer accepted by question author

  1. Viorel 126.9K 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. Viorel 126.9K 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.


  2. Olaf Helper 47,616 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

  3. Yitzhak Khabinsky 27,106 Reputation points
    2021-05-06T21:44:44.31+00:00

    Another way is via CASTing:

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

  4. Guoxiong 8,221 Reputation points
    2021-05-06T21:35:24.747+00:00

    Try to use Format function:

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

Your answer

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