cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Datetime field to mashup

DD_7886593
7-Bedrock

Datetime field to mashup

Hi, I have a CSV file with these parameters:

date_trunc;People_in_region

01.06.2017 00:01;4489

01.06.2017 00:19;4527

01.06.2017 00:31;4541

01.06.2017 00:46;4574

01.06.2017 01:01;4522

1/I have created a DataShape with two parameters:date_trunc as "datetime" and People_in_region as "Number"

2/ In my service code and my output as infotable:

var params = {

    path: "k.csv" /* STRING */,

    columnMappings:"date_trunc;People_in_region",

    hasHeader: true /* BOOLEAN */,

    //longitudeField: undefined /* NUMBER */,

    //dateFormat: undefined /* STRING */,

    fileRepository: "SystemRepository",

    //latitudeField: undefined /* NUMBER */,

    fieldDelimiter: ";" /* STRING */,

    stringDelimiter: "\"" /* STRING */,

    dataShape: "TFPeopledata" /* DATASHAPENAME */

};

var result = Resources["CSVParserFunctions"].ReadCSVFile(params);

When I execute the service, I get this error :

Wrapped java.lang.Exception: Unable To Convert From java.lang.String to DATETIME Cause: Unable To Convert From java.lang.String to DATETIME

any help please !

ACCEPTED SOLUTION

Accepted Solutions

You missed dateFormat parameter, you should set something like.

dateFormat: "dd.MM.yyyy HH:mm"

Previous Date Format string it's based on Java Joda time library

View solution in original post

1 REPLY 1

You missed dateFormat parameter, you should set something like.

dateFormat: "dd.MM.yyyy HH:mm"

Previous Date Format string it's based on Java Joda time library

Announcements


Top Tags