Forum Discussion
Date Changes when Changing Column Type
I have a table that has a DepartureTime column presented in local. I added a new column that converts this to UTC. I then duplicated the column and changed the type to Date, but when I do, the Date reverts to the date of the local column.
Here's an example; Row 6:
Does anybody have any thoughts/solutions?
Thanks,
Seth
- Anonymous4 years ago
I was able to solve this on my own by converting lcl to UTC and then removing the zone. This allowed me to set the new column to Date without dates reverting to lcl.
3 Replies
- lbendlinSuper User
Keep the column types as DateTimeZone during the ETL. Change the format only in the presentation layer (in the visuals)
- AnonymousNot applicable
Unfortunately, while the column appears to be a Date column, it's still a DateTime and so when using that field, a record for each Time shows up. Also, when connecting to another table in the Model view, the results are blank because the date column from my dates table doesn't have times so it will never match on DateTimeZone converted to Date in the presentation layer.
- AnonymousNot applicable
I was able to solve this on my own by converting lcl to UTC and then removing the zone. This allowed me to set the new column to Date without dates reverting to lcl.