This topic is locked

mySQL Time Data Field - Displays as Date

6/22/2009 8:53:05 PM
ASPRunnerPro General questions
B
bob@symantry.com author

I have a simple table in mySQL that has a Time data field.

When I create a list page for the table the Time field displays as todays date with an "AM" suffix.

That is, "6:22:2009 AM". And every record in the table shows the same data.

If I look at the data in the db directly, the times are all unique.

I created a simple ASP page using Dreamweaver and the Time field displays in a Date/Time format.

SQL Maestro for mySQL shows just the time. I'm using mySQL 5.0 and the 3.51 ODBC driver.
THis has to be a bug in ASPRunner 6.1, no?
Thanks /Bob

J
Jane 6/25/2009

Hi,
thank you for pointing me to this bug.

We'll fix it in the next update.

Z
zico 6/30/2009

I am possibly looking at a similar bug on PHPRunner 5.1, can you please confirm?
I have a field in mysql set as DATE. In PHPRunner I set it up to view as "Short Date" and edit as "Date".

I am using "After record updated" event to check if the date field has been changed and display a message (I check if there's a differences between $oldvalue["date"] and $value["date"]) .

My problem is - I always get a message that the date changed, even when I don't change it at all. When I display the two values I see that $oldvalue["date"] returns the correct value in date format (30/6/09), but $values["date"] returns a datetime value of 30/6/09 00:00:00. The 00:00:00 part is not written to the DB becuase it's a DATE field, but the check in the event always fails.
I tried to cap this using date($values["date"]) but this doesn't work. Still I get the 00:00:00 and the wrong message about date change.
Can you please help?

J
Jane 7/1/2009

Hi,
I recommend you to compare dates in Unix format:

if (strtotime($oldvalues["date"])-strtotime($values["date"])==0)

Z
zico 7/2/2009

Hi,

I recommend you to compare dates in Unix format:


Many thanks, works like a charm!