Questions tagged [datetime]

datetime refers to a string that contains a date part and a time part, in that order. Typically it refers to a date and time encoded according to the International Organization for Standardization (ISO) 8601 standard: Data elements and interchange formats -- Information interchange -- Representation of dates and times.

Filter by
Sorted by
Tagged with
1 vote
0 answers
9 views

Exporting layer with datetime field with milliseconds value

I have a layer with datetime field with milliseconds. I use the following script to get a QDateTime object and add it to a memory layer: layer = QgsVectorLayer("Point?crs=EPSG:4326", "...
user avatar
2 votes
0 answers
22 views

Displaying milliseconds in Attribute Table using PyQGIS

I have a datetime string with microsecond. I use the following script to get a QDateTime object and add it to a memory layer: layer = QgsVectorLayer("Point?crs=EPSG:4326", "test", &...
user avatar
1 vote
0 answers
15 views

Auto update date-time in QGIS

In QGIS 3.10 I need something to auto update a datetime attribute. I need it to update only when any other attribute is updated. I have tried the following: Steps: Add a Edited Date Field (ESRI uses ...
user avatar
  • 11
0 votes
0 answers
24 views

ArcGIS API for JavaScript 4.23 : Cannot use SQL CAST function with layer.definitionExpression but it work fine with query builder

I'm working with features which needs to be filtered. I need to use the definition expression : https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definition... ...
user avatar
  • 71
1 vote
1 answer
22 views

Check if one date before or after another date in Google Earth Engine

How do I check if one date is before or after another date using the Google Earth Engine Python API? In other words, I want to compare two dates like datetime object in Python. import ee firstDate=ee....
user avatar
  • 171
2 votes
0 answers
20 views

QGIS 3.16 Use change state of a checkbox as a trigger for updating another field

I want to record the date/time of field survey for features. This should only be updated at the moment a checkbox value is ticked. Further edits would be needed to the record later, either in the ...
user avatar
2 votes
1 answer
28 views

Date operation in the Query Builder withPostGIS layer

I would like to filter a PostGIS layer by a datetime (QDateTime) field. I only want to show elements newer then 14 days. I tried the following expression in the Quary Builder: (day(now() - "...
user avatar
  • 23
0 votes
1 answer
31 views

How to filter two time periods in a year?

Well, if I want filter to two time periods in a year. Just like 1989-01-01~1989-04-01 and 1989-10-01~1990-01-01.It is about the time series analysis. There is part of my code, something not shows ...
user avatar
0 votes
0 answers
23 views

How to convert UTC in LMT with field calculator in QGIS?

I have GPS data in shape format in QGIS. But in my attribute table only the UTC time is given in the form of 01.01.2022 05:00. Is it possible to add a new column with the field calculator where I can ...
user avatar
  • 39
7 votes
3 answers
164 views

Selecting latest record by date

At 3.22.1 I have a GeoPackage attribute table containing the string field: box_id and the date field: inspection_date. The table rows look like: box_id         inspection_date NE_01_01    2021-05-01 ...
user avatar
  • 6,973
0 votes
1 answer
66 views

SQL expression ArcPy date format

I'm trying to use definitionquery to keep entities where date is smaller or equal to a certain date ( variable entered by the user). The Variable and the field in the table are formatted as dates. ...
user avatar
  • 37
0 votes
1 answer
40 views

ArcPy select analysis date field > date variable

I am sure this is probably a simple syntax fix but I receive invalid syntax errors during the Select Analysis when trying to select records where the date field in my file geodb (ISS_CST) is greater ...
user avatar
  • 479
3 votes
3 answers
199 views

Removing the time zone from datetime field in QGIS

How can I get rid of the time zone in the date/time field? So I have a GeoPackage with the following data: and want to get just 2021-06-07 16:25:40
user avatar
3 votes
1 answer
44 views

QGIS attributes table shows wrong data when printing Timestamp with Milliseconds

I'm using QGIS to Debug Geometries and corresponding times. For that, I created GeoJSON in C# and added 3 timestamps as attributes: feature.Properties.Add("CreatedUTC", CreatedUTC.ToString(&...
user avatar
0 votes
2 answers
98 views

Customizing DateTime field in ArcPy data management feature

I have a table in SQL with one column TIMESTAMP which shows the date/time in the following format. 2019-05-31 08:09:20.000 In order to process the data in ArcGIS, I created a new table in ArcGIS. To ...
user avatar
  • 57
1 vote
0 answers
73 views

Datetime in ArcGIS Pro defaults to 12/30/1899

I have datetime field in a CSV with the following format: Time 2007-02-01 05:00:00+00:00 When I use the append tool in ArcGIS Pro to load data to a table on a SQL Server Enterprise geodatabase, ...
user avatar
3 votes
1 answer
2k views

Parsing/converting ISO 8601 datetime fields using pandas

I have a datetime field in a Pandas dataframe that becomes problematic when using ArcGIS Pro to load data from a csv to a table on ArcSDE. The field in Pandas looks like this: 2007-02-01T05:00:00....
user avatar
4 votes
3 answers
203 views

Capturing Date using Date and Time from Expression builder

I have a string that includes date and time like in this format: '23/02/2021 09:03', '24/02/2021 09:10' etc. I would like to use Rule based filtering to colour symbols that has date=23/02/2021. So ...
user avatar
  • 155
2 votes
1 answer
192 views

Convert time in float format to time format

I have a shapefile line layer with an attribute for time in float format. This is what 23.21 and 55 seconds looks like: 232155.17 This is 03.27 and 01 seconds: 32701.64 I would like to convert this ...
user avatar
1 vote
1 answer
156 views

ArcPy Select by attribute using create date

I'm writting a Python script that will look for newly created features and update them. This script will be automated to run every day at the end of the day. I'm using the Select by attribute tool to ...
user avatar
  • 335
0 votes
1 answer
150 views

Converting excel integer date format to datetime using QGIS

How to convert Microsoft Excel date format to datetime format using QGIS? In example: 43089 in MS Excel is 2017-12-20.
user avatar
  • 5,602
1 vote
1 answer
30 views

Calculating datetime difference using ArcPy [closed]

How would I calculate the time difference between two fields? For Example: 3/22/2018 7:08:00 AM - 3/22/2018 7:07:30 AM
user avatar
  • 21
0 votes
1 answer
107 views

ArcPy - Get Date as parameter value and calculate Date field

In my ArcPy script I have an input parameter for the Date, so the user is asked to input a date value (time is not needed) using the data type GPDate. In the script I calculate a new field, field data ...
user avatar
0 votes
1 answer
59 views

Separating date and time from the same column into two columns

If I have date and time in the same column how can I separate them in two columns in ArcMap? And how can I put the date in this format (year,month,day)?
user avatar
  • 1
1 vote
1 answer
44 views

Updating datefield from a string with UpdateCursor

I have a string I'm slicing and then using UpdateCursor to update rows with the outputs. The string is formatted like this: Foo_YYYYmmddHM_Xy_Ab_Bar I'm struggling in getting only the YYYYmmdd part of ...
user avatar
  • 363
1 vote
1 answer
190 views

Error when trying to add system:time_start when using reduceRegions in Google Earth Engine

I am reducing an image collection into a feature collection by using a function to map the reduceRegions function to each image in a collection. I'm trying to make sure the system:time_start property ...
user avatar
4 votes
1 answer
910 views

Converting string column to datetime column in QGIS

I have an attribute column that has a string datetime and I want to convert that to a date column. I first attempted to simply add the time column in an expression, and I only got the year/month/date, ...
user avatar
  • 41
0 votes
1 answer
250 views

GeoPandas dataframe from PostGIS table having date column

I have this PostgreSQL PostGIS database and I want to read this data in GeoPandas. I am able to create the GeoPandas database when I exclude the columns having dates/datetime #Reading data from ...
user avatar
3 votes
1 answer
60 views

Changing the time of a map label in QGIS using python

I would like to adjust the "[% format_date( now(),'dd/MM/yyyy HH:mm:ss') %]", as it currently displays 07/12/2020 13:31:40 on the map, as I am in the UK right now. However, I would like to ...
user avatar
  • 173
1 vote
1 answer
50 views

Convert the time to the suitable format using Pandas [closed]

I have a file whose name is "MCD43A3_Alb_QA_SWIR_2020_061.tif", and I want to split the time "2020_061" and convert to the format "2020-03-01", how can I do that? Here is ...
user avatar
  • 51
1 vote
1 answer
53 views

Selecting features by year in datetime field

I have a shapefile with a datetime field. I want to split the features by year and save into a geodatabase. My approach has been to create a list of years, and from there iterate over the list and ...
user avatar
  • 363
1 vote
1 answer
210 views

Calculating dates and using arcpy.CalculateField_management(

I am in the process of converting my scripts from python 2.7 to 3.x I am trying to calculate a date field with a datetime object exactScriptTime = datetime.datetime.now() exactScriptTime = ...
user avatar
  • 2,104
2 votes
1 answer
1k views

Setting Date and Time for QDateEdit and QTimeEdit

Working on a QGIS plugin, I am struggling to save/load date and time values. Users can enter dates via QDateEdit widget and times via QTimeEdit widget. Values are then stored the following: s = ...
user avatar
  • 24.6k
2 votes
0 answers
41 views

Time zone problem on a calculated field

I have configured a date/time field with the default value "now ()" on a shapefile. When I create an object in QGIS, the datetime is correct. In QField, there is a 2 hour lag. However, the ...
user avatar
  • 21
0 votes
1 answer
180 views

Can't create fields of type Time on shapefile layers [duplicate]

I wanted to create new field in QGIS to store date and time from a datetime string field named dateposte. Here is the code I used to make it: import datetime layers = QgsProject.instance().mapLayers(...
user avatar
  • 245
1 vote
2 answers
90 views

to_datetime in Python

I'm using QGIS 3.4 and I want to know how to convert a column datatype from string to datetime in python. I found that we can do that by to_datetime from the calculator but I want to do it from Python....
user avatar
  • 245
0 votes
1 answer
423 views

Trouble with using Freemarker to formate Date for GeoServer GetFeatureInfo

I'm having some trouble while trying to use the Freemarker Template to display dates in the desired format. I store points with a date information in a PostGIS database written through an FME-process ...
user avatar
2 votes
1 answer
701 views

MODIS 'system:time_start' format problem in Google Earth Engine

In Google Earth Engine, what is the default format of time_start for MOD10A1 image?For example, var modisCollection = ee.ImageCollection('MODIS/006/MOD10A1') .filterDate('2000-08-21', '2001-02-28')...
user avatar
  • 109
2 votes
1 answer
385 views

QGIS3: Import csv_file with DateTime Values

Has anyone managed to read in a "DateTime" value yet? I do not succeed, I always get text values. Test1 point_id,X,Y,ele,time,Ds,len "371",676239.6644,212505.7907,486,2020/04/07 09:58:07,0,0 "372"...
user avatar
  • 23
1 vote
0 answers
56 views

Accessing bands of a NetCDF by datetime in Python

I want to write each band as a separate file (after gdal.Translate operation). So I can directly address to each band by datetime, not by a number? The second way, more sophisticated is to get all ...
user avatar
1 vote
0 answers
627 views

Using ArcGIS Pro to select all data collected "Yesterday" regardless of the time of day

I am using ArcGIS Pro 2.4.3. I can upgrade if needed. I am reading a hosted feature layer from my Organisation's AGOL site in ArcGIS Pro. This is using the standard Esri Data Store. This dataset ...
user avatar
  • 2,088
3 votes
1 answer
132 views

Retaining subsecond time precision in date/time field in Geodatabase

I have a set of points (essentially tracks) with subsecond time precision, that would be useful to visualise/analyse. I have tried the "Convert Time Field" tool from string, float and double field ...
user avatar
  • 39
1 vote
1 answer
622 views

Datefilter in leaflet.js

How do I filter data by date. If I want to filter, I can see the old filtering too. The layers are stacked on top of each other. How do I get the current date range. <div id="time-ranges" class="...
user avatar
  • 13
2 votes
1 answer
461 views

Getting max() from list of dates using ArcPy [closed]

Using Python 3.6.8 I had the below portion of my script working previously on some test data, but now that I've tried to spool it up to the production data, it's not working. This is a snippet of a ...
user avatar
6 votes
1 answer
2k views

Mapping simple function to print date and time stamp on Google Earth Engine Python API

I am new to the Google Earth Engine Python API, and I am trying to create functions that when mapped over a collection will print some metadata (e.g. time stamp, band names) but I always get the same ...
user avatar
1 vote
2 answers
307 views

Handling, comparing, passing datetime variables with ArcPy

There are droves of questions on here about handling dates/times, and I've read through volumes of them, but still don't understand what I am doing wrong. I am trying to run a simple Python script in ...
user avatar
0 votes
0 answers
57 views

ArcGIS Select attributes X weeks before or after current date

I'm working on a project where the data gets updated every Monday (an XLSX file which I bring into a File Geodatabase and work with from there). I've been tasked with automating the data massaging. ...
user avatar
  • 11
0 votes
2 answers
642 views

GeoServer Timestamp/Timezone error convert

Date format in PostgreSQL, -> 2019-10-30 08:46:44 Created WFS, but got a problem. GeoServer is converting the date. I think it somehow something with timezones. Output WFS -> 2019-10-30T07:46:44Z ...
user avatar
0 votes
0 answers
45 views

Select domain's last update date

I have tables in an Oracle 18c GDB that I integrate to a work order management system. I create views on the tables to translate the data. For example, I translate domain codes to domain descriptions. ...
user avatar
  • 754
0 votes
1 answer
280 views

Editor Tracking: What is the mechanism behind this functionality?

I have Editor Tracking enabled on a table in an Oracle enterprise geodatabase (versioned): Tracking an editor's changes to data says: ArcGIS automatically records new editor tracking values ...
user avatar
  • 754