Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Monday, 26 June 2023

How to Configure DataBase TimeZone

 

Listing out current database timezone 


SQL: show variables like '%time_zone%';






database default timeZone is EDT timeZone.

Configure current Database console time_zone


SQL: set time_zone = 'America/Chicago';

Reset the current database session to another timeZone.

Showing current DateTime


SQL: select now();

Tuesday, 20 July 2021

Insert OffsetDateTime into PostgreSQL

 The SQL standard differentiates timestamps with time zone and without time zone literals by the presence of a "+" or "-" symbol and time zone offset after the time. Hence, according to the standard,

Without time-zone

'1999-01-08 04:05:06'                        

With time-zone

'1999-01-08 04:05:06 -8:00'




Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...