Forum Discussion
Enter Time Into Date/Time Column?
I'm tracking outages of certain systems and need to calculate down to the second, but date/time in SharePoint only allows me to enter Time up to minutes (11:54am for example, instead of 11:54:22am).
Is there anyway I can set up a custom column or something to allow this? Any third-party (free) options to allow this? Sometimes the outages are less than a minute but still need to be tracked (outage might be from 9:35:22am to 9:35:53am for example).
- michalkornetIron Contributor
HI PatrickM135, seconds are also stored in the DateTime column, so you can use column formatting to display the time with seconds in the list. Here's an example:->
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=toLocaleDateString(@currentField) + ' ' + toLocaleTimeString(@currentField)"
}The challenge, however, is how to edit the value. If you can use SPFx Form customization, you can leverage the PnP Control for the DateTime column to include seconds as well: -> https://pnp.github.io/sp-dev-fx-controls-react/controls/DateTimePicker/