Wednesday, December 3, 2008

Re: Current datetime in model

how about

$currentTime = date('Y-m-d h:i:s'); //check the format for the date
command, I may be off.

Then use $currentTime in your query....

On Dec 2, 8:47 am, Alexey Grunichev <grunic...@gmail.com> wrote:
> Does cake contain any functionality to pass as parametr in condition
> function current time?
> I need a query such as:
> Select * from ... where exp_datetime < NOW()
> If I passexp_datetime < NOW() in condition it won't work in MSSQL (it
> used GETDATE())
> I need a cross-db solution.
>
> I can use application time, but app and db could be located at
> different physical servers in different time zones and in this way I
> should replace all used default timestamps functionality in db.
>
> So, I wonder to know, does cake contain functionality to pass as
> current time function as condition in Model?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: