我Ubuntu 18.04在psql (PostgreSQL) 12.2 (Ubuntu 12.2-2.pgdg18.04+1)
运行temba=# create extension postgis;失败并出现以下错误
ERROR: could not open extension control file "/usr/share/postgresql/10/extension/postgis.control": No such file or directory
Run Code Online (Sandbox Code Playgroud)
我跑了find /usr -name postgis.control才发现postgis.control是在一个名为12而不是10
laptop@xyz-x:~$ find /usr -name postgis.control
/usr/share/postgresql/12/extension/postgis.control
Run Code Online (Sandbox Code Playgroud)
编辑 1
我已经跑了 sudo apt-get install postgis
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgis is already the newest version (3.0.1+dfsg-2.pgdg18.04+1).
0 upgraded, 0 newly installed, 0 to remove and 0 …Run Code Online (Sandbox Code Playgroud) String startDateStr = "2017-02-03"
DateFormat formatter = new SimpleDateFormat("yyyy-MM-DD",Locale.US);
Date date = (Date)formatter.parse(startDateStr);
Run Code Online (Sandbox Code Playgroud)
2017-02-03日期解析为Tue Jan 03 00:00:00 GMT+05:45 2017
我错过了什么?
更新
我需要将一个字符串转换为日期对象,同时保持相同的格式。
这样做的原因是我想利用public boolean after(Date when)方法