How can I get diff in seconds between two string datetime fields on server script. After this I want to use the method frappe.utils.format_duration() to get this different in a pretty way.
1 Like
first_date=frappe.utils.get_datetime("2023-01-01")
second_date=frappe.utils.get_datetime("2023-01-24")
diff=frappe.utils.time_diff_in_seconds(second_date,first_date)
pretty=frappe.utils.format_duration(diff)
3 Likes