Skip to main content
April 15, 2024
Solved

Function todate() different times

  • April 15, 2024
  • 5 replies
  • 0 views

Hi! Does anyone know how can I fixed the next situation?


I want to get the date of a datetime using the function todate() but if the datetime is after 9PM (Chile Time), the result for the function is not the real date but the next day and this should only happens when the time is past 12 AM.

    Best answer by shubhama926776

    todate(local(ri!DateTime,"CLT"))

     [mention:d9737c9b566a47159485a573139116ad:e9ed411860ed4f2ba0265705b8793d05]  Try this

    datevalue(tostring(ri!DateTime))

    5 replies

    shubhama926776
    Brainy
    April 15, 2024

    Try Using this logic

    date(
    year(ri!DateTime),month(ri!DateTime),day(ri!DateTime)
    )

    शुभम्
    April 15, 2024

    It didn't work :( I still getting the next day if the hour is after 9PM

    shubhama926776
    Brainy
    April 15, 2024

    todate(local(ri!DateTime,"CLT"))

     [mention:d9737c9b566a47159485a573139116ad:e9ed411860ed4f2ba0265705b8793d05]  Try this

    datevalue(tostring(ri!DateTime))

    शुभम्