Hello,
I'm importing data with timestamps from and SQLite file, here is a time stamp as an example: 2024-04-12T18:55:42.464558Z. Since JMP doesn't support microseconds I'm trimming the last 8 characters and converting the column into a time format. Everything seems to work up to this point. However, when I attempt to increment each timestamp by 6 hours (time zone differences) all the timestamps are simple deleted.
dt = Current Data Table(); // Gets the currently active data table
// Check if the "timestamp" column exists
If( Contains( dt << Get Column Names("String"), "timestamp"),
// Get the column reference
col = Column(dt, "timestamp");
// Truncate the last 8 characters from each value in the "timestamp" column
col << Set Each Value( Substr( Char( col ), 1, Length( Char( col ) ) - 8 ) );
// Convert the truncated timestamps to numeric datetime values
col << data type(numeric) << modeling type(continuous) << format("yyyy-mm-ddThh:mm:ss");
// Subtract 6 hours from each datetime value using Date Increment
For( i = 1, i <= N Rows(dt), i++,
If( !Is Missing( col[i] ),
col[i] = Date Increment( col[i], "Hour", -6 );
);
);
Show("Timestamps have been truncated and decremented by 6 hours.");
,
// Error handling if column does not exist
Show("Error: 'timestamp' column does not exist in the current data table.")
);
What would be the correct way to basically convert the timestamps into a format that's acceptable for JMP and increment each value by -6? Thank you!