ISO 8601 Datetime Format

Remco
Member Posts: 81
Hi,
I receive an datetime in an ISO8601 format (2011-12-16T15:08:02Z).
I want to import this datetime in NAV and split it up to a Date and Time field.
Any ideas how to do this?
According to the NAV Help function of the format property NAV can handle this <Standard Format,9>
I receive an datetime in an ISO8601 format (2011-12-16T15:08:02Z).
I want to import this datetime in NAV and split it up to a Date and Time field.
Any ideas how to do this?
According to the NAV Help function of the format property NAV can handle this <Standard Format,9>
0
Comments
-
MyText := '2011-12-16T15:08:02Z'; MyTextDate := COPYSTR(MyText,9,2) + '-' + COPYSTR(MyText,6,2) + '-' + COPYSTR(MyText,1,4); MyTextTime := COPYSTR(MyText,12,8); EVALUATE(MyDate,MyTextDate); EVALUATE(MyTime,MyTextTime);
0 -
Depends on which way you are importing the data. If as part of XML, it will work automatically, if you are assigning them into DateTime variable (you can than split them to date and time by standard functions DT2Date and DT2Time). If you are importing them through different way, you need to parse it. NAV is able to "generate" this string through the format, but I am not sure if you can EVALUATE it to DateTime variable automatically (may be yes).0
-
Try with
EVALUATE(dt,'2011-12-16T15:08:02Z',9);
Where dt a DateTime variable. (Note the third parameter to EVALUATE.)0 -
Thanks, the last suggestion works!!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions