web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Convert time to 12 Hours format to 24 Hours format

(0) ShareShare
ReportReport
Posted on by 198

Hi there we got an requirement to develop an CSV file generation of some of the fields from RetailTransactionTable and SalesLine which will be useful to integrate with other platforms. Here our client want the time in 24 hours format but we are passing in 12 Hours format with AM/PM and also Date field needs to be DateTime. Please find my requirements mentioned below and suggest me accordingly.

1. RetailTransactionTable.transtime will return 12 Hours format with AM/PM. I need to change this to 24 Hours format as H:M:S  format

2. SalesLine.ShippingDateRequiested  will return only date but our client wants display this in CSV as DateTime with YYYY/MM/SS H:M:S  format

Thanks,

Prem

I have the same question (0)
  • AR-01121610-0 Profile Picture
    4,967 Moderator on at

    Hy, I wouldn't do any changes here on code base or the stored format inside D365FO. Instead I would prefer to process the required format after being exported from D365FO, depends on how you create (DMF ?) and transport the csv file. As I know the requested Shipping date can only be entered from user as a date without time.

    kr Andreas

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    HI premK6969

    1. I believe you have wrong information here. It's stored in the database in seconds. How you see it in D365 forms depends on your own user settings.

    2. You can add 00:00:00 in your export file

  • premK6969 Profile Picture
    198 on at

    Hi Nikolaos,  is there any way to convert 12 Hours to 24 Hours since it was requested by client and regarding the second point we will inform them to update manually.

    field Name : RetailTransactionTable.transTime

    Base Output : H:M:S AM/PM

    Required Output :  H:M:S 24 Hours Format

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    My suggestion is to export the data as it is (seconds) and let the consumer of the CSV file determine how to show it to the users.

    You can use time2Str function to convert time to string: docs.microsoft.com/.../xpp-conversion-run-time-functions

    However I have a feeling that you're trying to solve the formatting in the wrong place. Normally this kind of formatting should happen when the information is displayed to the user. Not when a CSV file is exported from the system. Could you please double check this with your customer?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans