XMLport datetime to export

snyktpsnyktp Member Posts: 75
Hello

I want to export xmlport. I use datetime in my xmlport. But I want to show my datetime like this ;
2003-04-05T03:35:55.553Z
How can I do this?

Thank you

Comments

  • SogSog Member Posts: 1,023
    using the format type
    <year>-<month,2>-<day2>T<Hours24>:<Minutes,2>:<Seconds,2>.<Second dec.>Z
    The help file of NAV (quick key F1) has an extended topic on Format (in the C-side reference part)
    Or even faster: <standard format,9> (where 9 is the xml standard in NAV for date, time and datetime)
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • snyktpsnyktp Member Posts: 75
    Hello,

    I have tried this; FORMAT(CURRENTDATETIME,9). It doesnt work..

    Thank you for the answer
  • SogSog Member Posts: 1,023
    That's the wrong syntax.
    The syntax for the format function in C/AL is
    String := FORMAT(Value [, Length] [, FormatStr/Number])"
    
    So in your case it would be something like
    Format(Currentdatetime,0,'<standard,9>');
    
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • kinekine Member Posts: 12,562
    To export/import datetime correctly when using XML standard you need to ROUND the datetime before exporting. It means just using
    MyDateTime := ROUNDDATETIME(MyDateTime);
    

    to round the value to seconds.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.