How to set Timestamp in Comments

Hi, the comments show only the number of days/months ago when was posted. We need to know the timestamp, is there a way of changing this setting?

Thanks!

1 Like

@info
You can add hook before_insert event on doctype comment.

and add python code to save current time in comment.

import datetime
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

https://frappe.github.io/frappe/user/en/guides/basics/hooks.html

Thank you for your answer.

But comments are not DocTypes, themselves they can be attached to any DocType.

@info comments are separate doctype,
If you are using v6, then comments are stored in Communication DocType, for Older version comments stored in Comments DocType.