pers0n Posted January 17, 2012 Share Posted January 17, 2012 I need to have events, they can have startDate, startTime, endDate, endTime. But but not all events will have a startTime, endDate, endTime. So I made those 4 fields seperate. But when I leave those 3 that arent always used, it puts in "12/31/1969" for the date or "07:00" for the time if they are left empty. I am checking for null, but its not saying its null, but I left the fields empty. Link to comment Share on other sites More sharing options...
Pete Posted January 17, 2012 Share Posted January 17, 2012 The date you're experiencing is when unix time is counted from (you'd have to google it to find out why - I can't remember) so a value of zero means zero seconds since that date. Strange but true. Link to comment Share on other sites More sharing options...
Pete Posted January 17, 2012 Share Posted January 17, 2012 Of course I just realised you may already know that and the date/time field should probably know that too is probably what you mean Link to comment Share on other sites More sharing options...
diogo Posted January 18, 2012 Share Posted January 18, 2012 What about doing something like this on each one of them (not tested): if ($page->startDate != "12/31/1969") echo $page->startDate; Link to comment Share on other sites More sharing options...
apeisa Posted January 18, 2012 Share Posted January 18, 2012 That is bad default and I think this have been fixed already. Have you tried latest commit yet? Link to comment Share on other sites More sharing options...
pers0n Posted January 18, 2012 Author Share Posted January 18, 2012 Upgraded to 2.2 and the values are null as hoped. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now