This topic is locked

date properties generating errors

11/30/2008 9:58:13 PM
PHPRunner General questions
Allenh author

version 672

we're using dynamic permissions (which we works great) but we're experiencing constant problems with date fields. If the properties are set to anything other than drop down boxes an error is generated and the record does not created.

Anyone else having problems with dates? Any cures?

J
Jane 12/1/2008

Hi,
what field types do you use for date fields?

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

Allenh author 12/3/2008

Haven't had time to publish this yet, but the data is field in mysql is date - should we be using something else?

Hi,

what field types do you use for date fields?

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

C
chaintm 12/3/2008

Haven't had time to publish this yet, but the data is field in mysql is date - should we be using something else?


would use unix time stamps , the mysql timestamp just has to many compatibility issues with most things, using the conversion to the unix timestamp makes it all numeric. If you look threw the boards here, there is allot on it, here is a conversion for you...field names are just what I use, but you can ofcourse use whatever, also change your mysql fields on your database to just use verchar or numeric , thou if you have a ton of data on dates, this can be daunting to change all the data in your site and database.
I use the built in calander and just input the fields as user friendly reading.. then the following converts the field into unix timestamp and saves to database.
Before record Event
// convert standard input to unixtime stamp

$values["event_time_start"] = strtotime($values["event_time_start"]);

$values["event_time_end"] = strtotime($values["event_time_end"]);
To convert back to edit fields (is what I use the following for to change the values back to readable values in a field)
Edit Page before event
// reverse the unixtime stamp to display (usually in editing)

global $control_event_time_start,$control_event_time_end;

if ($control_event_time_start["params"]["value"])

$control_event_time_start["params"]["value"]=date("m/d/Y h:i:s",$control_event_time_start["params"]["value"]);

if ($control_event_time_end["params"]["value"])

$control_event_time_end["params"]["value"]=date("m/d/Y h:i:s",$control_event_time_end["params"]["value"]);
Hope this helps, I know its a pain, but it is what I ended up doing, sense then, doing time/date comparissons and more has been super easy.

J
Jane 12/4/2008

Allen,
Date is correct field type.

It's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

C
chaintm 12/4/2008

Allen,

Date is correct field type.

It's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.


yea my bad,
Just thinking of something that worked out for me, but if you publish it to demo, Jane is the master of all ! Best support ever! She will definitly figure it out for you.

T
thesofa 12/5/2008

Hey Jane, no pressure eh!