Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Server Timezone #2

Open
brunobritodev opened this issue Aug 2, 2021 · 1 comment
Open

SQL Server Timezone #2

brunobritodev opened this issue Aug 2, 2021 · 1 comment

Comments

@brunobritodev
Copy link
Contributor

brunobritodev commented Aug 2, 2021

When running from local machine at Sql Server on Docker some queries get broken because the TimeZone.

At PedidoAPI:
image

But there are items at Database:
image

So, sending the "DateTime.Now" from API Backend it works:

      public async Task<PedidoDTO> ObterUltimoPedido(Guid clienteId)
        {
            const string sql = @"SELECT
                                P.ID AS 'ProdutoId', P.CODIGO, P.VOUCHERUTILIZADO, P.DESCONTO, P.VALORTOTAL,P.PEDIDOSTATUS,
                                P.LOGRADOURO,P.NUMERO, P.BAIRRO, P.CEP, P.COMPLEMENTO, P.CIDADE, P.ESTADO,
                                PIT.ID AS 'ProdutoItemId',PIT.PRODUTONOME, PIT.QUANTIDADE, PIT.PRODUTOIMAGEM, PIT.VALORUNITARIO 
                                FROM PEDIDOS P 
                                INNER JOIN PEDIDOITEMS PIT ON P.ID = PIT.PEDIDOID 
                                WHERE P.CLIENTEID = @clienteId 
                                AND P.DATACADASTRO between DATEADD(minute, -30,  @Now) and @Now
                                ORDER BY P.DATACADASTRO DESC";

            var pedido = await _pedidoRepository.ObterConexao()
                .QueryAsync<dynamic>(sql, new { clienteId, Now = DateTime.Now });

            if (!pedido.Any())
                return null;

            return MapearPedido(pedido);
        }
brunobritodev added a commit that referenced this issue Aug 2, 2021
fix: database connection string
refactor: docker
fix: issue #1
fix: issue #2

BREAKING CHANGE: .NET 5
brunobritodev pushed a commit that referenced this issue Apr 19, 2022
# 1.0.0 (2022-04-19)

### Bug Fixes

* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))

### BREAKING CHANGES

* .NET 5
brunobritodev pushed a commit that referenced this issue Apr 19, 2022
# 1.0.0 (2022-04-19)

### Bug Fixes

* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))

### BREAKING CHANGES

* .NET 5
brunobritodev pushed a commit that referenced this issue Apr 19, 2022
# 1.0.0 (2022-04-19)

### Bug Fixes

* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))

### BREAKING CHANGES

* .NET 5
brunobritodev pushed a commit that referenced this issue Apr 20, 2022
# 1.0.0 (2022-04-20)

### Bug Fixes

* Adding generic health checks ([2f837c7](2f837c7))
* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))

### BREAKING CHANGES

* .NET 5
brunobritodev pushed a commit that referenced this issue Apr 20, 2022
# 1.0.0 (2022-04-20)

### Bug Fixes

* Adding generic health checks ([2f837c7](2f837c7))
* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))

### BREAKING CHANGES

* .NET 5
brunobritodev pushed a commit that referenced this issue Apr 20, 2022
# 1.0.0 (2022-04-20)

### Bug Fixes

* Adding generic health checks ([2f837c7](2f837c7))
* adding multiple database flavors ([cad806b](cad806b))
* class name ([daaf343](daaf343))
* conf.d ([c22b9df](c22b9df))
* Desabilitando GRPC ([971e0cc](971e0cc))
* docker files ([d8c7090](d8c7090))
* Docker-compose improvemements ([7462399](7462399))
* EnsureDatabase Minimal API e connection strings ([d9583bf](d9583bf))
* Erro de DI na program.cs ([edc1ba2](edc1ba2))
* git mv ([0543ff8](0543ff8))
* identity jwt configuration ([947bc72](947bc72))
* Melhorias ([a6c3014](a6c3014))
* migration ([415c8a4](415c8a4))
* old migrations and jwt ([89a7edc](89a7edc))
* remocao config nginx ([6f68534](6f68534))
* removing  nginx ([6be39ac](6be39ac))
* route ([ccf5935](ccf5935))
* route error and local culture ([ce0d9cf](ce0d9cf))

### Features

* .NET 5 ([a50636d](a50636d)), closes [#1](#1) [#2](#2)
* .NET 6 ([430151e](430151e))
* .NET 6 & Dockerfile ([2bb76e3](2bb76e3))
* Auto PFX generation, .net 6 Program.cs, docker ready ([8af1e89](8af1e89))
* **cart:** translations ([88acee8](88acee8))
* **catalog:** Translations ([dee07a2](dee07a2))
* Converting ShoppingCart to MinimalAPI ([ca879b4](ca879b4))
* Initial commit ([28a7f52](28a7f52))
* multidatabase & pfx ([33361c4](33361c4))
* **mvc:** translations ([abb057c](abb057c))
* refresh token ([3be6704](3be6704))
* security upgrades ([d6f0c9a](d6f0c9a))
* serilog & seq ([d79e675](d79e675))

### BREAKING CHANGES

* .NET 5
@wzuqui
Copy link

wzuqui commented Apr 21, 2022

Can I make a suggestion? I work with multi time zone application and the best solution is to work everything in UTC. Just like the plane works, that ZULU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants