I am trying to format a date.
2015-12-01T00:00:00.000Z
Into
12/01/2015 12:00AM
Now I have the following code to remove the Z and T and pass in a format that would work, but it looks like it is changing the minutes into hours, because it always put the minutes down as 12, when there is a 0 in the number.
2015-12-01T11:09:00.000Z
converts to
12/01/2015 11:12AM
Here is the code:
%%[
IF @key == "send_date" OR @key == "activity_date" THEN
SET @time1 = Row(@fourthActivtiesRowSet, 3)
SET @time2 = Row(@fourthActivtiesRowSet, 4)
SET @value = CONCAT(@value, ":",Field(@time1, 1), ":", Field(@time2, 1))
SET @separateDate = BuildRowsetFromString(@value,"T")
SET @rowDate = Row(@separateDate, 1)
SET @date = Field(@rowDate, 1)
SET @rowTime = Row(@separateDate, 2)
SET @time = Field(@rowTime, 1)
SET @dateTime = CONCAT(@date, " ", @time)
SET @separateDate = BuildRowsetFromString(@dateTime,"Z")
SET @rowDate = Row(@separateDate, 1)
SET @dateTime = Field(@rowDate, 1)
]%%
<td>
%%=Format(StringToDate(v(@dateTime)), "MM/dd/yyyy HH:MMtt")=%%<br>
%%=v(@value)=%%
</td>
%%[ endif ]%%
Please advise on how to get the minutes to use 60 and the hours to use 12, right now it looks like the minutes is formatting to 12. Also, please upvote this, I am not up to 15 reputation yet to vote people up.