Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将整数转换为日期Postgres dblink_Php_Date_Casting_Int_Dblink - Fatal编程技术网

Php 如何将整数转换为日期Postgres dblink

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_

我有一个包含值的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_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格式;