schotime / NPoco

Simple microORM that maps the results of a query onto a POCO object. Project based on Schotime's branch of PetaPoco
Apache License 2.0
848 stars 302 forks source link

Ability to not use UTC by default while still being able to use the nuget package #655

Open IvoTops opened 2 years ago

IvoTops commented 2 years ago

There are two places where NPoco forces UTC to be on. I am now using a modified fork because of this. Which IMHO should not be necessary, right?

I cannot switch to UTC with 200+ tables and couple of billion rows. I would love to, it's just not happening.

Is it possible to introduce a global static switch somewhere? These two places are the culprits as far as I can tell;

public sealed class JSONParameters { ...... public bool UseUTCDateTime = true;

public PocoColumn() { ForceToUtc = true;

schotime commented 2 years ago

Yeah, this seems like a good feature. Just need to think about how to implement this without breaking anyone and allowing the most flexibility.

Ideally globally you want to be able to UTC, but to be overridden at the property.

IvoTops commented 2 years ago

My use case requires a global setting to not use utc. Its only two or three places in the npoco codebase that I changed to fix this for me. I think adding a global static boolean DateTimeAsUTC which defaults to True and is read on those places should fix it. Without breaking anything I would guess. Is there a logical place for this global setting?

On Tue, Mar 22, 2022, 05:34 Adam Schroder @.***> wrote:

Yeah, this seems like a good feature. Just need to think about how to implement this without breaking anyone and allowing the most flexibility.

Ideally globally you want to be able to UTC, but to be overridden at the property.

— Reply to this email directly, view it on GitHub https://github.com/schotime/NPoco/issues/655#issuecomment-1074716609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5YHTWLBHHOWWC6LIHLYCLVBFEWVANCNFSM5QMQQFRA . You are receiving this because you authored the thread.Message ID: @.***>