DATETIME(6) vs TIMESTAMP(6)

Hi Experts,

Which one of the above mentioned datatype would be advisable while storing a datetime value in DB and what will be the advantage of one over other while using it in APPIAN.

Thanks,

Gaurav Singh

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    So just a quick reference shows that TIMESTAMP is almost identical, except that the first one in the row will automatically store the exact time that the row was made.  So you'd use TIMESTAMP primarily for audit purposes, such as createdOn or modifiedOn.

    You could theoretically use DATETIME for that too, and for other things as well.  It appears there's no real functional advantage to TIMESTAMP unless you want to take advantage of the automatic time writing functionality.  I'd also take a look at how accurate Appian's dateTime type is, because you could be wasting bits of precision if you make your DB more precise than Appian.  The extra will just be truncated or rounded.

    (Of course, assuming your post is in regard to the MariaDB DATETIME vs. TIMESTAMP)

    mariadb.com/.../

Reply
  • 0
    Certified Lead Developer

    So just a quick reference shows that TIMESTAMP is almost identical, except that the first one in the row will automatically store the exact time that the row was made.  So you'd use TIMESTAMP primarily for audit purposes, such as createdOn or modifiedOn.

    You could theoretically use DATETIME for that too, and for other things as well.  It appears there's no real functional advantage to TIMESTAMP unless you want to take advantage of the automatic time writing functionality.  I'd also take a look at how accurate Appian's dateTime type is, because you could be wasting bits of precision if you make your DB more precise than Appian.  The extra will just be truncated or rounded.

    (Of course, assuming your post is in regard to the MariaDB DATETIME vs. TIMESTAMP)

    mariadb.com/.../

Children
No Data