Focal Point
Converting Mysql Dates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2701019331

October 26, 2005, 07:35 PM
Greg
Converting Mysql Dates
My mysql database stores dates like this:

1122305842 <--- number of seconds since 1970.

This is a ticket create date for my help-desk.

If I view the ticket, the php code displays the date as:

October 18th, 2005, 9:59 am

I am trying to figure out how to get the date to display this same way in my WF reports.

is /60 /60 /24 /365.25 the best way to accomplish this?

I am hoping someone has dealt with this before and already has it figured out.

Greg
October 26, 2005, 08:48 PM
Francis Mariani
I'm not sure about mssql, but for other DBMS defining a date field like this works:

DB2 -

FIELD=ACT_PRFL_END_DT, ACT_PRFL_END_DT, HYYMDS, DATE, MISSING=OFF, $

MS SQL Server -

FIELD=RECCREATEDATE, RECCREATEDATE, HYYMDs, HYYMDs, MISSING=ON, $

There's an explanation in the manual about the difference between HYYMDs and HYYMDS, something about thousands of a second.
November 02, 2005, 03:18 PM
Kerry
Hi Greg,

Did Francis' suggestion help you? The following topics from Information Builders' online documents may be of interest:

Take a date that is stored as seconds and convert to MDYY http://techsupport.informationbuilders.com/sps/12782022.html

How to change a HYYMDS to ALPHA format?
http://techsupport.informationbuilders.com/sps/91691097.html

You may also want to take a look at Vivian's post about the reference book, 1001 Ways to Work With Dates in WebFOCUS and FOCUS, which shows a lot of way to work with WebFOCUS dates and date conversions.

Hope this helps.

Cheers, Big Grin

Kerry
November 10, 2005, 06:58 PM
Greg
I opened a helpdesk ticket for this and Caesar was able to provide me with the information I needed.

http://techsupport.informationbuilders.com/app/css_web_...nd_how_to_deal_w.htm