Please Log in to join the conversation.
//String is contained in an array, in MM/DD/YYYY format ie 09/22/2011
// exploding puts the string into an array, [0] is 09, [1] is 22, [2] is 2011
$date = explode("/", $data->{recent_games}[1]->last_played);
// Rearrange them to CB liking
$dateformat= ($date[2]."/"."0".$date[0]."/".$date[1]);
//This part posts the properly formatted string to the date field
$user->cb_lastactive = $dateformat;
$user->store();
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
busterocaps wrote: My apologies. if you read the first post you see that I was trying to send a string to a CB date field from some code I had modified in a cb plugin, and I couldn't get it right. I could get the field on the tab to show up, but the DATE field wouldn't save until I added that code in the second post. After a lot of trial and error I finally got it to go in there but I had to jack it around to do it. I have no idea why, so I posted my solution to the problem.
Please Log in to join the conversation.
Please Log in to join the conversation.