Skip to content

SqlServerObjectToStringTranslator supports DateTime and DateTimeOffset, while SqlServerConvertTranslator does not #14193

Closed

Description

@MaxG117

SqlServerObjectToStringTranslator supports DateTime and DateTimeOffset, so dateTime.ToString() translates to a server-executed SqlFunctionExpression CONVERT(VARCHAR(100), dateTime).

SqlServerConvertTranslator does not support DateTime or DateTimeOffset, so Convert.ToString(dateTime) is evaluated locally, returning a string representation that is different from SqlServer's string representation of DateTime returned by the CONVERT function.

Is there a reason for this inconsistency or is this an oversight?

Further technical details

EF Core version: 2.2.0

Activity

  1. smitpatel commented on Dec 17, 2018

    @smitpatel
    Contributor

    Oversight.

  2. added
    help wanted
    on Dec 17, 2018
  3. added this to the Backlog milestone on Dec 19, 2018
  4. self-assigned this
    on Jan 9, 2019
  5. modified the milestones: Backlog, 3.0.0 on Jan 9, 2019
  6. modified the milestones: 3.0.0, on Feb 6, 2019
  7. added
    good first issue
    on May 31, 2019
  8. modified the milestones: , 3.0.0 on Nov 11, 2019
  9. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customer-reportedgood first issuehelp wanted

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions