1

I always used the formula (below) in Python Calculator to convert the date format from Julian to Gregorian format. But,now a weird behaviour is happening and I am trying to figure out what is wrong in the processing. I am using QGIS 3.12 and after processing the formula no errors rises, but when I opened the new field in the table a little problem is detected. There is a empty space (4 spaces) between Year and Month parts of the date and I'm not able to identify this error and remove It. The new format date generated is "2016-***[space]***01-12 23:45" and the correct and expected result should be "2016-01-12 23:45".

Following the formula I'd used:

timestampparts=<Date_Time_Local>.split(' ')  
dateparts=timestampparts[0].split('-')  
timeparts=timestampparts[1].split(':')  
newdate='{0[2]}-{0[0]}-{0[1]} {1[0]}:{1[1]}'.format(dateparts, timeparts)  
value=newdate

And the output of conversion process:

date conversion process

There is something I can do to fix It?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.