Change text field to date:time

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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?
Photo of Sam Krausz

Sam Krausz

  • 470 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
Try this

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

ToTimeStamp($DatePart, $TimePart )
Photo of Sam Krausz

Sam Krausz

  • 470 Points 250 badge 2x thumb
Thanks for your help

But....

I am getting an error "incorrect variable type"

Any idea what this is?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
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 )
Photo of Sam Krausz

Sam Krausz

  • 470 Points 250 badge 2x thumb
I am not getting any error massages

But when I save it, the cell is blank, no data in the cell
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
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 )
Photo of Sam Krausz

Sam Krausz

  • 470 Points 250 badge 2x thumb
Thanks for the great help

It's really appreciate, it was a big help

Thanks