Skip to main content
Content Starts Here

We've Moved!

Please note that we have moved to our New Forum site.


Ask Search:
Jay PixlerJay Pixler 

How do you convert an infomart timestamp like mediation_segment_fact.start_ts to an actual 'dd-mm-yyyy hh:mi:ss' date field?

Best Answer chosen by Jay Pixler
Jay PixlerJay Pixler
Hi Nikolas, it's Oracle DB and this worked like a charm.  I also found a date/time field start_ts_time in the mediation_segment_fact_gi2 table you mentioned which provided what I needed today but the conversion you provided will help me for years to come.  Many thanks, Jay

All Answers

Nikolas HoldenNikolas Holden
What is your database platform. For Oracle the syntax is to_date('1970-01-01', 'YYYY-MM-DD') + [field name]/86400.  The filed name in this case would be START_TS.  In the MSF GI2 view the timestamp has already been converted to the date time.  And be wary of any UTC conditions on your server.  You may need to adjust for DST.

I'm not sure what the conversion would be for other DB's but a search on google using temrs such as convert unix time stamp to datetime should give you a place to start.
Jay PixlerJay Pixler
Hi Nikolas, it's Oracle DB and this worked like a charm.  I also found a date/time field start_ts_time in the mediation_segment_fact_gi2 table you mentioned which provided what I needed today but the conversion you provided will help me for years to come.  Many thanks, Jay
This was selected as the best answer