Jump to content

strtotime giving me the ole' 1969 error


easyedy

Recommended Posts

Hi all I'm trying to format some calendar dates for my site and since some of the calendar listings are way down the road in the future the time is "Call For Time" and when I try to format it I'm getting the 1969 error. Any thoughts on how I can change the code to work:

 

$datelisting = strftime("<b>%b. %d, %Y</b><br>%A %l:%M %P", strtotime($datelisting]));

echo $datelisting;

 

$datelisting before formatting is: 09/12/2008 Call For Time

 

Here is what my code spits at me:

 

Dec. 31, 1969

Wednesday 4:00 pm

 

What I want is:

 

Sept. 12, 2008

Call For Time

 

 

Any ideas? Thx.

 

-E

 

 

Link to comment
https://forums.phpfreaks.com/topic/99048-strtotime-giving-me-the-ole-1969-error/
Share on other sites

You've got some funky stuff going on. Like that random bracket at the end.

 

Try ...

<?php
echo date('<b>M d, Y</b><b\\r />l g:i A', strtotime($datelisting));
?>

 

And if that doesn't work, echo what $datelisting is and show us exactly what's being passed in.

You've got some funky stuff going on. Like that random bracket at the end.

 

 

Yeah it was an array var I made it general for here and forgot to take out the bracket...

 

Unfortunately, you  code gave me the same things.

 

$datelisting gives me this: 09/12/2008 Call For Time

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.