Hello, I hope you're doing well. I'm using the Mix...
# questions
s
Hello, I hope you're doing well. I'm using the Mixpanel API to send data, and I've encountered an issue related to the date format when sending check-in and check-out data. Currently, I'm using the following Kotlin method to convert dates into a format compatible with the Mixpanel API:
Copy code
eventObject.props.put("checkIn", getTimeWithZoneOffset(request.checkIn))
    eventObject.props.put("checkOut", getTimeWithZoneOffset(request.checkOut))

    private fun getTimeWithZoneOffset(localDate: LocalDate?): Date? {
        val currentTime = LocalTime.now()
        val dateWithTime = LocalDateTime.of(localDate, currentTime)
        return Date.from(dateWithTime.toInstant(ZoneOffset.UTC))
    }
However, the dates and times I'm sending are being received in an undesired format. The dates arrive as follows: example send JSON:
Copy code
{
  "checkIn": "2024-01-01",
  "checkOut": "2024-01-05",
  "destinationId": 5,
  "locale": "es-mx",
  "rooms": [
    {
      "adults": 2,
      "children": []
    }
  ]
}
🆘 1