5

You probably use shapefile format. Otherwise it should have worked. According to the documentation shapefile format doesn't store date and time in the same field. You need to add date and time to seperate columns or use other format like GeoPackage.


5

I tried to use a csvt file (like documented at https://anitagraser.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/) to force the type when adding "Delimited text layer". If I tick the "Detect field types" or not, I get the same issue as you: no clues why too... To get what I want, I have to go another way. I create your sample file ...


3

"Any Python datetime function can be used to calculate a date" Try: #import arcpy, datetime fc = r'C:\data.gdb\features123' date_field = 'datefield' now = 'datetime.datetime.now()' arcpy.CalculateField_management(in_table=fc, field=date_field, expression=now)


3

(Your questions is better suited for stackoverflow.com) But try using pd.to_datetime and pd.DateOffset: import pandas as pd import os filename = r'/home/bera/Downloads/MCD43A3_Alb_QA_SWIR_2020_061.tif' def fixdate(full_path_and_filename): d = os.path.splitext(full_path_and_filename)[0].split('_')[-2:] #['2020', '061'] d = pd.to_datetime(d[0], ...


2

I did not find a function for adding hours to a date so here's a workaround expression: format_date(make_datetime(year(now()), month(now()), day(now()), hour(now()) - 6, minute(now()), second(now())),'dd/MM/yyyy HH:mm:ss')


2

arcpy.SelectLayerByAttribute_management expects you to specify a field based SQL as the where_clause. Your cap_date_q.date.year looks like a class property in python not a proper clause. Since you are after only the years, you can use EXTRACT operator, for example: SelectLayerByAttribute_management(SHP, "NEW_SELECTION", 'EXTRACT(YEAR FROM "...


2

Basically you have to use .setDate() for QDateEdit and .setTime() for QTimeEdit, not .setDateTime() and convert strings to QTime via QTime.fromString() or to QDate via QDate.fromString(). But: in this case it is a little more complicated, because QtCore.QDateTime.currentDateTime()) is in QDateTime-Format. So in this case, QDateEdit, has to be set using ....


1

Postgres is case sensitive. The error message tells you that issue_date is not found, and goes as far as suggesting that you may be meaning Issue_date, with a capital I. To reference an uppercase column name, it must be within double quotes select "Issue_date" from myTable You would have to escape it within the query string sql_base = "select ...


1

You can use the python datatime module: import datetime str_date = '2019-11-17 15:42:04' date = datetime.datetime.strptime(str_date, '%Y-%m-%d %H:%M:%S') In QGIS 3 you can use the following expression: to_datetime('2019-11-17 15:42:04')


1

It's the number of milliseconds since the epoch (1 Jan 1970). You can convert it to an ee.Date object to use various date methods, including formatting for printing. var modisCollection = ee.ImageCollection('MODIS/006/MOD10A1') .filterDate('2000-08-21', '2001-02-28') print(ee.Date(modisCollection.first().get('system:time_start')).format("yyyy-MM-dd")) ...


Only top voted, non community-wiki answers of a minimum length are eligible