Php 如何将整数转换为日期Postgres dblink
我有一个包含值的int变量,例如31012015,但我尝试将日期格式转换为dd-mm-yyyy。我的部分问题是:Php 如何将整数转换为日期Postgres dblink,php,date,casting,int,dblink,Php,Date,Casting,Int,Dblink,我有一个包含值的int变量,例如31012015,但我尝试将日期格式转换为dd-mm-yyyy。我的部分问题是: select * from dblink( 'dbname=dbexample port=5432 host=127.0.0.1 user=postgres password=root', 'select * from tableexample where fconclusion between 2014-01-02 and 2014-12-31') as k( id_
select * from dblink(
'dbname=dbexample port=5432 host=127.0.0.1 user=postgres password=root',
'select * from tableexample where fconclusion between 2014-01-02 and 2014-12-31')
as k(
id_principal integer,
nestrategia smallint,
ctitulo character varying(300),
factivacion date,
nestado smallint,
fcreacion timestamp without time zone,
id_usuario integer,
nstatus smallint,
nmunicipio smallint,
nactividad smallint,
fconclusion date,
id_personal integer,
nactivo smallint,
fmodificacion date,
nconclusion smallint
)
PgAdmin显示下一个错误:
错误:运算符不存在:日期>=整数
提示:没有运算符与参数的名称和类型匹配。您可能需要添加显式类型转换。
上下文:名为unnamed的dblink连接出错:无法执行查询
有人能帮我吗?试试:
$dt=DateTime::createFromFormat'dmY',$int;
echo$dt->d-m-Y格式;