Jump to content
cjx2240

Two dates, both stored the same way, one works with strtotime and one doesnt.... help!

Recommended Posts

Got a bit of a weird one. I've got a date field, I've added a date in two different pages using the calendar selector. It has saved, and stored in the same format in the database.

I can echo out the date no problem for both dates, it exists.

However, if I use strtotime() (or wireDate()) on this date, one of them works, and one of them does not. 

var_dump($page->custom_date);
var_dump(strtotime($page->custom_date)); 

1: 

image.png.2fb3f5c54904e76a27820c7db7236fa8.png

2:

image.png.4bfd6f5280ff15d53d548b57244c0ef1.png

 

Share this post


Link to post
Share on other sites

Using / as dividers signifies an American date format of MM/DD/YYYY, which makes only the latter invalid.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...