Share via

Facing issue regarding sharepoint date time format.

Anonymous
2023-06-12T05:53:43+00:00

I have a share point website where we are storing some data, there are two columns one having date and another is time, the predefined syntax is date&time , whenever i passed date from excel sheet , till date 12 it is taking date and time format but after 12 it is taking only date, i have tested with only the date format but there is issue because we have time column and also date, so i can't fix with the date only, is there any way to separate the columns, like for date we can only use date format and for time we can use the time format in the same share point sheet or anything in the excel so that we can pass in a fixed format, i have done some test with the excel sheet also, like define the date and time format separately but that is not working.

thanks!

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2023-06-13T12:41:10+00:00

    Hi Mousmi Kumari,

    Thanks for posting back.

    For the two date columns, please check their settings via the down arrow of the column> Column settings> Edit, and make sure "Include Time" is enabled.

    If the option is already enabled, please check if the two date columns have been applied JSON formatting. Please click the down arrow of the date column> Column settings> Format this column> click Advanced mode. Please backup the existing code, remove the code, click Save, then check if items after 12 show time in the date column.

    We look forward to your response. Thanks for your cooperation.

    Sincerely,

    George | Microsoft Community Moderator

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-06-23T03:27:59+00:00

    Hi Mousmi,

    Sorry for my late reply.

    To create one column that only shows the date and one column that only shows the time, please try the following steps.

    1. Please create a Date and time column. Make sure the option "Include Time" is enabled.

    1. Currently, this Date and time column will show the date and time. You can use JSON code to hide the time. Please click the down arrow of this column> Column settings> Format this column> Advanced mode> remove the existing code, then paste the following code.

    {

      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",

      "elmType": "div",

      "txtContent": "=toLocaleDateString(@currentField)"

    }

    After that, this Date and time column includes the date and time, but it will only show the date.

    1. Create a calculated column to only show time.

    Go to Settings> List settings> Create column> choose "Calculated" and input the following formula. Remember to substitute your column names.

    =TEXT([Date-JSON format],"hh:mm AM/PM")

    Here is the result. Please check if it meets your needs.

    We look forward to your response. Thanks for your cooperation.

    Sincerely, 

    George | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-06-19T06:10:54+00:00

    Hi,

    Thankyou for your response , In my situation in a single share point site i wanted to show date in one column and time in another column, yes there is one option like if we will not select the include time checkbox then only date will show but if we want to add only time in different column in the same sharepoint site then what we can do?

    Thanks!

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-06-12T10:04:47+00:00

    Hi,

    Thanks for your quick response,

    1. For sync the changes we are using power automate flow, in share point we have one library file where we have a template/excel file, in which users entering there data and then the flow triggers and it will pick the data from the excel and post it into the share point site.
    2. Before 12 it is taking like in the given snip -

    1. After 12 it is taking like -

    1. From edit in grid view we can manually change it but i want it should be in a particular format , because we have lots of data , if we go with the manual changes with the grid view it will take lots of time.

    thanks!

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-06-12T09:36:38+00:00

    Hi Mousmi Kumari,

    Thanks for posting in the community. We are happy to help you.

    According to your description, I would like to collect more information about the situation.

    1. How do you update the item in the list? Do you manually edit the item or use other methods to sync changes?
    2. Please provide a full screenshot of your list. If it contains private information, please mask the related content.
    3. What if you click "Edit in grid view", then copy the correct value to the item (after 12), does it only show the date?

    We look forward to your response. Thanks for your cooperation.

    Sincerely,

    George | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments