Skip to main content
Question

Change text field to date:time

  • June 25, 2017
  • 0 replies
  • 87 views

How can I change this: shipment-date
2017-06-25T04:59:14+00:00 which is now a text field to this: 2017-06-25 04:59:14 as a date/time field

What is the formula syntax to do it?
This topic has been closed for replies.

Try this

var Date DatePart = Left([shipment-date],"T");
var TimeOfDay TimePart = Right([shipment-date],"T");

ToTimeStamp($DatePart, $TimePart )

  • Author
  • Registered
  • June 26, 2017
Thanks for your help

But....

I am getting an error "incorrect variable type"

Any idea what this is?

re: Any idea what this is?
yes: Sloppiness on my part :)

OK, let's try that again
Try this

var Date DatePart = ToDate(Left([shipment-date],"T"));
var TimeOfDay TimePart = ToTimeOfDay(Right([shipment-date],"T"));

ToTimeStamp($DatePart, $TimePart )

  • Author
  • Registered
  • June 26, 2017
I am not getting any error massages

But when I save it, the cell is blank, no data in the cell

OK, this is tested

var date DatePart = Date(
ToNumber(Left([shipment-date],4)),
ToNumber(Mid([shipment-date],6,2)),
ToNumber(Mid([shipment-date],9,2)));

var TimeOfDay TimePart = ToTimeOfDay(Mid([shipment-date],12,5));

ToTimestamp($DatePart, $TimePart )

  • Author
  • Registered
  • June 26, 2017
Thanks for the great help

It's really appreciate, it was a big help

Thanks