0

Please how can I fetch data from database based on Los Angeles Time Zone on Ktor using Ktorm plugin with postgres database.

This is the sample code, but I don't know how to write the query for the sorting based on the timezone

fun getAll(offset: Int = defaultOffset, limit: Int = defaultLimit, filter: String = ""): List<Customer> {
        val results=  db
            .from(Customers)
            .select()
            .limit(offset = offset, limit = limit)
            .orderBy(Customers.creationDate.desc())
            .map { row -> Customers.createEntity(row) }
            .map { it.toView() }

        return results


    }
Aleksei Tirman
  • 4,658
  • 1
  • 5
  • 24
ABSheikh
  • 1
  • 2

0 Answers0