Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BirtDateTime adds Default Month, Day and Year of Jan 1st, 1970
motodave452
<p>Hello,</p>
<p> </p>
<p>I am trying to increase a time value that starts out as 9:28:34 PM by "count" minutes each time my fetch script executes:</p>
<p> </p>
<p>startTime = BirtDateTime.addMinute(startTime, count);</p>
<p> </p>
<p>These values are going to be X-Axis labels. The problem that I am having is that BirtDateTime adds a default Month, Day, and Year of Jan 1, 1970 to startTime. Is there an easier way to add the "count" minutes or to possibly suppress or get rid of the Month, Day, and Year that BirtDateTime adds?</p>
<p> </p>
<p>Thank you very much for your help!</p>
<p> </p>
<p>-Dave</p>
Find more posts tagged with
Comments
Matthew L.
<p>If your using a scripted data set, you could use the following example to accomplish this.</p>
<p>In the open method I set the values with the following:</p>
<pre class="_prettyXprint _lang-js">
i=0;
startTime = BirtDateTime.now();
</pre>
<p>Then in the fetch method I format the output to the row and increment the startTime time stamp:</p>
<pre class="_prettyXprint _lang-js">
if(i++ < 5){
row["Column1"] = Formatter.format(startTime,"hh:mm:ss a"); //Formatted output
startTime = BirtDateTime.addMinute(startTime,1); //Add 1 minute
return true;
}else
return false;
</pre>
<p>See attached example</p>