Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi
I am using a CSV parser extension to import a CSV file from the local machine. The timestamp is in UNIX format and I want to convert it into a proper DATETIME format. The datashape basetype for Timestamp is number.
Is there a way to convert it into
Solved! Go to Solution.
Try looping your result infotable, and for each row assign the new date with this logic
ConvertedDate = new Date(unix_timesamp * 1000);
Hi,
Try this in a service:
var date = new Date(timestamp * 1000);
result= date;
Hope it helps,
Raluca Edu
Hi raluca_edu
Thanks for the quick response.
What I am trying to do here is getting the Timestamp values from the CSV file and I want them to be converted into DATETIME(for which you have given the snippet). I am stuck at a point where I want to convert the entire Timestamp column and the result should be in the same Infotable with Date column and Basetype already initialised in the Datashape
Attached is a screenshot of the service result. I want the DATETIME result to be populated there itself
Try looping your result infotable, and for each row assign the new date with this logic
ConvertedDate = new Date(unix_timesamp * 1000);
Hi @ketanaga.
If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon