Announcement

Collapse
No announcement yet.

Date format in Miva DB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Date format in Miva DB

    Afternoon all,
    Does anyone have some information on the orderdate format in the database? Unfortunately, this is saved as a varchar(10) as opposed to a date-time - so to convert it (not in the database, just in a display), I need to understand what format the text is saved in. As an example, I have an entry in orderdate that is: '1454068965'.
    Last edited by macrobber; 03-27-17, 12:25 PM. Reason: Clarifying the question.

    #2
    It's a unix timestamp defined as the number of seconds since Jan 1 1970. If you just need to convert a few, here's a website that does it: http://www.onlineconversion.com/unix_time.htm
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      I'll need to do it dynamically in a query, but that does give me a head start. Thanks!

      Comment


        #4
        You can use from_unixtime for that: https://dev.mysql.com/doc/refman/5.5..._from-unixtime
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Bingo!

          Comment

          Working...
          X