I have a int(11) column: creation_time that gets the following code when that row is created.
creation_time = application.getTimeStamp()/1000;
I have a seperate calcuation as a DateTime format. So that I can show this information to the client but it is read only.I have the field fomatted as MM/dd/yyyy.
created = newdate(creation_time*1000);
I have tried to write a method that will bring up all the rows that were created today.
But everything I can think of either gives me no records or all the records.
I’m sure this can be done, I just am not doing the right thing. Any ideas?
Just a question: why do you make your life harder than it is and don’t you just store your timestamp as what it is?
But if it has to be like that, wouldn’t something like this work:
// Get the beginning of today
var vStart = new Date();
vStart.setHours(0);
vStart.setMinutes(0);
vStart.setSeconds(0);
// Get the end of the day
var vEnd = new Date();
vEnd.setHours(23);
vEnd.setMinutes(59);
vEnd.setSeconds(59);
// Create those "timestamps"
var vStartInt = vStart.getTime() / 1000;
var vEndInt = vEnd.getTime() / 1000;
controller.find();
timestamp = 'vStartInt...vEndInt'
controller.search();
Unfortunately I have to conform to Unix Timestamp. Hence the need to get to seconds instead of milliseconds.
Thanks. I’ll give it a try.
I plugged it in and unfortunately, it provovided me with 0 found records when it should have found 1.
Then turn the stacktrace on and look at the SQL statement actually fired. If that looks reasonable, try to use that statement directly and see what happens.