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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

JProperty is converting JSON Datetime to US format

(1) ShareShare
ReportReport
Posted on by 17
Hi, 
 
I am working on JSON file and the file comes with Datetime 
when the JProperty converts the date to US date format
 
but it works correctly with date and converts the date when it is DateTime.
 
Any solution for this?
Thanks
 
I have the same question (0)
  • Khushbu Rajvi. Profile Picture
    22,106 Super User 2026 Season 1 on at
    What is the issue? I’m having difficulty understanding your question.
  • MR-13061333-0 Profile Picture
    17 on at
    Hi Khushbu,
     
    I am importing a Json file to Business Central table I can see the datetime is in ISO format in first screenshot but when I call JSONMgt.GetValueAndSetToRecFieldNo( function the Value in below function changes the date in datetime value into mm/dd/yyyy format. The datbase is UK based so it does fail.
     
    Thanks
     
      procedure GetPropertyValueFromJObjectByPathSetToFieldRef(JObject: DotNet JObject; propertyPath: Text; var FieldRef: FieldRef): Boolean
        var
            OutlookSynchTypeConv: Codeunit "Outlook Synch. Type Conv";
            JProperty: DotNet JProperty;
            RecID: RecordID;
            Value: Variant;
            DecimalVal: Decimal;
            BoolVal: Boolean;
            GuidVal: Guid;
            DateVal: Date;
            Success: Boolean;
            IntVar: Integer;
        begin
            Success := false;
            JProperty := JObject.SelectToken(propertyPath);
     
            if IsNull(JProperty) then
                exit(false);
     
            Value := Format(JProperty.Value, 0, 9);
  • Suggested answer
    Vahid Ghafarpour Profile Picture
    12,228 Super User 2026 Season 1 on at
    Did you try to use JsonValue.AsDateTime()?
     
    May it help you
     
     

    ** Please don't forget to close up the thread here by Like and verify it as an answer if it is helpful **

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,804 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,103 Super User 2026 Season 1

#3
Kamal Khakhkhar Profile Picture

Kamal Khakhkhar 695

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans