We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to use prefix for Model and table with timestamp with time zone

Hi Folks,

I need help on below points:

  1. I have a table like 'epmsites', I need help to create model for this. if I am using 'epmsites' model are working fine. But I need models with prefix 'epm'. _2. I have a field in postgresql like 'createdate' with 'timestamp with time zone', let me know what is correct date() regexpression or method to add this.

Thanks



593
edited Mar '16

Use following in model:

public function initialize() { $this->setSource("epm_sites"); }

date("c")

c ISO 8601 date (added in PHP 5) 2004-02-12T15:19:21+00:00

https://php.net/manual/en/function.date.php