Formatting to seperate incoming data strings?

I’m using the code below in a workflow that splits and imports data sent out via the Particle.io integration.

image

I’m splitting incoming data using the “:” Semicolon.

Can I change the Semicolon “:” to something else like the asterisk “*” ?

The reason I ask is because I’m trying to import a formatted time string but the semicolon’s in the time cause issues with the importing since I’m separating the imported string data via Semicolons.

Separating data in a string via something other than the Semicolon should fix the problem.

I’m currently importing time in UNIX format but don’t see any easy way to reformat that to a human-readable format.

Hi @RWB,

If you were to have data come in separated by asterisks, you would still be able to utilize split and keep your timestamp together in the Function Node. :smile:

Thanks!
Julia

Perfect!

And while were on the Time subject, is there a easy to use piece of code that would allow a simple conversion of UNIX time to a more easy to understand format?

Hi @RWB,

I should have included previously, you can also use the String Node with the split operation if you would like to use it in place of the Function Node. :smile:

You can easily format dates using the Date/Time Node, and you can also specify a format using Moment.js (such as YYYY-MM-DDTHH:mm:ssZ) and even a timezone.

Thanks!
Julia