search

Home  >  Q&A  >  body text

Hive query: Convert date timestamp to date format

<p>I want to convert a date timestamp column containing something like '4/12/2023 15:37' to a date format, like: 2023-12-04, using a Hive query. Using the to_date format just returns me null values. </p>
P粉504920992P粉504920992478 days ago619

reply all(1)I'll reply

  • P粉827121558

    P粉8271215582023-08-15 10:53:46

    SELECT TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP('04/12/2023 15:37', 'd/MM/yyyy HH:mm')));

    reply
    0
  • Cancelreply