Git Product home page Git Product logo

Comments (4)

chullybun avatar chullybun commented on May 26, 2024

Hi there. Unfortunately, no there is not a simple way to change this behaviour. And, yes you may request this as a feature enhancement ðŸĪŠ I think that this should be relatively straight forward(-ish) change - I will look into it 👍

from beef.

edjo23 avatar edjo23 commented on May 26, 2024

Awesome, thanks. Much appreciated 😄

from beef.

chullybun avatar chullybun commented on May 26, 2024

OK. Took a little longer than expected, but I think I have got there.

The Beef.Entities.Cleaner class has a DefaultDateTimeTransform that can now be set (overridden); I have defaulted this to DateTimeUtc (the previous version was DateTimeLocal) - so this is a change in behaviour. The code-gen has been updated so that the default options for StringTrim, StringTransform and DateTimeTransform will be UseDefault. They can still be overridden where required; e.g. DateOnly. Internally, anywhere that a DateTime.Now was being performed, it is wrapped as Cleaner.Clean(DateTime.Now) to ensure the right DateTimeKind is applied.

Note that the ADO.NET framework always returns a DateTime with DateTimeKind.Unspecified - it's Kind is set accordingly, but no adjustment to the time zone is made as it is assumed it was persisted as the defined DateTimeKind (e.g. UTC or local). Both the SQL DATETIME and DATETIME2 do not store offset, you would need to use DATETIMEOFFSET if required.

I'll publish the updated NuGet packages in the next hour or two. Let me know how you get on. You might owe me a Jee's Burger for this one 😜

from beef.

edjo23 avatar edjo23 commented on May 26, 2024

Thanks for that. Yeah that was more than I was expecting 😄. I'll get this in as soon as possible and let you know how we go.

Yes Jee's Burgers on me, I do hope they are still around, it's been a couple months since I've been into the city!

from beef.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google âĪïļ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.