Forum Discussion
Convert a columns of datatype datetimezone to datetime
Hi h4tt3n ,
You can acheive this by splitting the column.Below i have attached the screenshots for your understanding.
This is your orignal column with Datetimezone
Split Column
Split column:
Select or enter delimeter : Custom
Use +
Split at: Left-most delimeter
Click on OK
Result :
Result,which is a datetime datatype.
If your problem is solved please accept this as solution.
Thank you
- h4tt3n6 years ago
Helper V
orry, this simply discards timezone info, it doesn't incorporate it into the time. However, I have found the solution with a python script.
- artemus6 years ago
Microsoft Employee
In effect you are asking to convert a datetimezone value to a datetime in UTC:
let dtz = ..., udtz = DateTimeZone.SwitchZone(dtz, 0), dt = DateTimeZone.RemoveZone(udtz) in dt - Macc-PA5 years ago
Helper I
Hi, Can you share the steps you used to add the timestamp to the date using python
- h4tt3n5 years ago
Helper V
Macc-PA I think this is the script. After all, it's one year ago, and we ended up not using it anyway.
import pytzimport datetimetz = pytz.timezone('Europe/Copenhagen')dt = datetime.datetime.utcnow()offset_seconds = tz.utcoffset(dt).secondsoffset_hours = offset_seconds / 3600.0#print ("{:+d}:{:02d}".format(int(offset_hours), int((offset_hours % 1) * 60)))print( offset_hours )