Options

Format(datetime,0,9)

ara3nara3n Member Posts: 9,258
Hello

In 4.0 using function format for datetime with 3rd parameter 9 returns.

it returns
2008-03-01T01:38:10Z

running the same code in 5.0 returns
2008-03-01T13:38:10Z
.

Notice the 13 instead of 01 for the hours.

evaluate(mytime, '9:38:10 AM');
evaluate(mydate, '3/1/2008');

message(FORMAT(CREATEDATETIME(mydate,mytime),0,9));



:bug:
Ahmed Rashed Amini
Independent Consultant/Developer


blog: https://dynamicsuser.net/nav/b/ara3n

Comments

  • kinekine Member Posts: 12,562
    There are more :bug: which will be solved in some hotfix around this "XML DataTime standard". Try to export some data with DateTime in XML format 9 through dataport and try to import it back. You cannot because the syntax is not recognized... ;-)

    And try to just export Time - it will be shifted by timezone too leading to wrong time in the XML (of course when imported back, all is ok, but if external application will take that...).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,258
    The client can't upgrade the exe right now.
    What is a quick way to solve it. The function is used in a lot of places.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    This seems like good example for MSFT support...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,258
    I have found a workaround.
    FORMAT(myDate,0,9) + 'T' +FORMAT(mytime,0,9)
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.