11-19-2007 08:18 AM - edited 03-15-2019 07:18 AM
Hi
Im trying to run a query through Query Analyser on CallManager 4.1(3)
The query runs fine except for the date and time (which for me is the important part). It seems that the date/time is being returned to me in some form or seconds since 1970 (I believe this is from UNIX).
All I am running is a
select * from CallDetailRecord
Does anyone know code to add in that will convert this date/time number in my result?
Thanks
Michael
Solved! Go to Solution.
11-19-2007 08:25 AM
Hi Michael,
I beleive this is referred to as "Universal Time". Here is some related info;
Date Format in the CDR Database
In order to select all calls after a certain date, you need to convert the date you want into a value in universal time and in seconds since January 1st, 1970.
For example, 973995954 translates to 11/12/00 2:25 AM. Complete these steps in order to decipher the time stamp.
Go to Microsoft Excel.
In cell A1 type the number that is found in the last record for dateTimeOrigination.
In cell A2, paste the formula =A1/86400+DATE(1970,1,1).
Right-click on cell A2 and select format cells.
Under the Number tab select Time where the format is 3/14/98 130 PM.
The result is the actual time in readable format.
From this excellent doc;
Using SQL Queries to Search the Call Detail Record with Cisco CallManager
Hope this helps!
Rob
PS: Ithink these tools work as well :)
11-19-2007 08:25 AM
Hi Michael,
I beleive this is referred to as "Universal Time". Here is some related info;
Date Format in the CDR Database
In order to select all calls after a certain date, you need to convert the date you want into a value in universal time and in seconds since January 1st, 1970.
For example, 973995954 translates to 11/12/00 2:25 AM. Complete these steps in order to decipher the time stamp.
Go to Microsoft Excel.
In cell A1 type the number that is found in the last record for dateTimeOrigination.
In cell A2, paste the formula =A1/86400+DATE(1970,1,1).
Right-click on cell A2 and select format cells.
Under the Number tab select Time where the format is 3/14/98 130 PM.
The result is the actual time in readable format.
From this excellent doc;
Using SQL Queries to Search the Call Detail Record with Cisco CallManager
Hope this helps!
Rob
PS: Ithink these tools work as well :)
11-19-2007 10:54 PM
SQL Query like this does the conversion in SQL, GMT times.
use cdr
select DATEADD(ss, datetimeorigination, 'Jan 1, 1970 00:00:00')
AS "datetime GMT", callingpartynumber, finalcalledpartynumber,
originalcalledpartynumber, duration, datetimeorigination
from calldetailrecord
You can adjust for timezone, with a select entry including adjustment below. 21600 is # of seconds for 6 hour offset for CST.
DATEADD(ss, datetimeorigination-21600, 'Jan 1,
1970 00:00:00')
AS "datetime GMT-6"
11-20-2007 03:47 AM
Thanks for the replies on this
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide