Quick Base Discussions

Expand all | Collapse all

Change text field to date:time

  • 1.  Change text field to date:time

    Posted 06-25-2017 17:54
    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?


  • 2.  RE: Change text field to date:time

    Posted 06-25-2017 17:59
    Try this

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

    ToTimeStamp($DatePart, $TimePart )


  • 3.  RE: Change text field to date:time

    Posted 06-25-2017 20:07
    Thanks for your help

    But....

    I am getting an error "incorrect variable type"

    Any idea what this is?


  • 4.  RE: Change text field to date:time

    Posted 06-25-2017 20:10
    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 )


  • 5.  RE: Change text field to date:time

    Posted 06-25-2017 20:41
    I am not getting any error massages

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


  • 6.  RE: Change text field to date:time

    Posted 06-25-2017 20:54
    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 )


  • 7.  RE: Change text field to date:time

    Posted 06-25-2017 21:54
    Thanks for the great help

    It's really appreciate, it was a big help

    Thanks