Using FROM_UNIXTIME Correctly
Hello,
I think this problem is an easy fix, but it has proven difficult for me. I've imported some data from Hubspot about my contacts, and I'm trying to convert one column from UNIX into a human readable time using a calculated field. (I validated it before and Domo said it was good to go).
This is my formula: DATE_FORMAT(FROM_UNIXTIME(`Became a Lead Date`), '%m,%d,%y')
What I get is shown in the attached image.
Anyone know what I did wrong?
Best Answer
-
ahhhhhh okay, try this to convert it in Beastmode. If it doesn't work in Beastmode you will have to cast it as a BIGINT in a dataflow transform.
from_unixtime(yourDate/1000)
-Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.3
Answers
-
Hi,
Instead of using the wrapper of DATE_FORMAT(), could you just use FROM_UNIXTIME(`yourDate`,'%Y-%m-%d')?
Let me know if this helps.
Thanks,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.1 -
Thanks for the suggestion, I did that and now it says the date is invalid. I guess it's a step forward because it's recognizing it as a date.
0 -
Can you try it without formatting, so just
from_unixtime(yourDate)
I just tested and this worked for me.
Thanks,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
If this doesn't work, you should make sure your field is actually in UNIX time
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
It did not work and it is formatted in UNIX time, but in Milliseconds, at least according to Hubspot's API documentation. Are UNIX times not normally in milliseconds?
https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis0 -
ahhhhhh okay, try this to convert it in Beastmode. If it doesn't work in Beastmode you will have to cast it as a BIGINT in a dataflow transform.
from_unixtime(yourDate/1000)
-Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.3
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive