We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19802
    • 7 Posts
    Hi all,
    I am using sql to retrieve some data from modx tables.

    How can i convert field createdon to display like a regular date in sql?

    createdon is ’1222369880’ and I can’t convert it to ’22.10.2008’ format.
      • 26903
      • 1,336 Posts
      You can use the MYSQL function from_unixtime(), e.g

      SELECT from_unixtime(createdon)......

      rather than

      SELECT createdon.......

      This gives back a standard time formatted string, you may be able to change this format using other MYSQL functions, see the MYSQL manual.
        Use MODx, or the cat gets it!