Hi , I have a requirement where te date format yyyy-mm-dd should be converted to milliseconds. I tried using htime but it is giving me wrong result. Please let me know the function tat wud solve my issue.This message has been edited. Last edited by: Kerry,
April 14, 2011, 04:13 PM
Francis Mariani
How does one convert a particular date to milliseconds? Milliseconds is a duration.
I can tell you how many milliseconds are in one day (1 day = 24 hours = 86,400,000 milliseconds), I can tell you how many milliseconds there are in 24 June, 2011, the same number as in 17 February, 1993 - every day has the same number of milliseconds.
I can tell you how many milliseconds there are between 5 August 2003 and 14 April 2011 - is that what you're looking for?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 14, 2011, 04:21 PM
Prarie
Well this hasn't happened in forever. Welcome LMP - wonder why you did not have to put what version you are using. Thought that was a requirement when registering......
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
April 14, 2011, 04:35 PM
LMP
Sorry if my question was wrong.
I am doing a Java rewrite to Web focus.
In java the milliseconds of a date is retrieved using Date.getTime() function. The input to this function is a date of format yyyy-mm-dd. I am expecting something similar in webfocus.
By the way i am using WF version 7.6.9
Thanks, LMP
7.6.9, Windows Excel and HTML
April 14, 2011, 04:51 PM
Francis Mariani
Give me an example of a result of the Date.getTime() function.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
For some reason, the base date needs to be near 1970/01/02/20:00:00 to get close to your value of 1,302,494,520,000. My code gives 1,302,494,400,000. So the base date needs to be tweaked by some minutes...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 15, 2011, 02:10 PM
LMP
Hi Francis,
Thanks a lot. Tat worked. Now i want to convert milliseconds obtained back to a Timestamp .ie date and time.
I am completely new to WF. Hence the struggle. Searched the forum.. but cudnt find one.
Please let me know how to convert the ms to date-time.