Jump to content

[SOLVED] strtotime is giving me ulcers...


musclehead

Recommended Posts

Hi everyone...I'm sure this is a ridiculously-easy question, but I'm killing myself trying to figure it out.

 

I have a date string field, let's say:

 

$theDate = '12-25-2008';

 

When I echo that variable, it displays beautifully...however, when I try this:

 

echo strtotime($theDate);

 

I get nothing...absolutely nothing is printed on the page...I am completely and utterly stumped...someone cure my insanity/stupidity! Thanks!

Link to comment
https://forums.phpfreaks.com/topic/126809-solved-strtotime-is-giving-me-ulcers/
Share on other sites

http://www.gnu.org/software/tar/manual/html_node/Calendar-date-items.html#SEC116

 

Read up

 

<pre><?php

var_dump( strtotime('12-25-2008') );

var_dump( strtotime('12/25/2008') );

var_dump( strtotime('2008-12-25') );

?></pre>

 

bool(false)
int(1230192000)
int(1230192000)

 

 

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.