https://kotlinlang.org logo
Title
a

Aminu Babayo Shehu

01/25/2023, 3:53 PM
Hello please help, I want to query records from Postgres database using order by
creation_date,
the creation_date is
UTC
please how can I query the result using the
PST
time zone USING KTOM in KTOR This is my query:
val customers = db
._from_(Customers)
._select_()
._limit_(offset = offset, limit = limit)
._orderBy_(Customers.creationDate._desc_())
._map_ *{* row *->* Customers.createEntity(row) *}*
b

Benoît Liessens

01/25/2023, 4:56 PM
Sorting by date is independent of timezone.
a

Aminu Babayo Shehu

01/25/2023, 4:57 PM
So please how can I transform the column date to date in pdt
b

Benoît Liessens

01/25/2023, 5:28 PM
Don’t know the DateTime APi by hard but something along
DateTimeFormatter.ISO_DATE_TIME.parse( column).toDate(ZoneId.of(“PST”))
a

Aminu Babayo Shehu

01/25/2023, 5:38 PM
Thank you. But this cannot work KTORM query api
b

Benoît Liessens

01/25/2023, 5:51 PM
I do not get the correlation with ktorm.
a

Aminu Babayo Shehu

01/26/2023, 12:55 PM
ok, I mean select using
at timezone