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)
Getting Date of Text File
mwallis
<p>I am reading data from a text file as a data source. I also need to get the date of the text file for display. How can I get the date of the text file I opened as a data source?</p>
<p> </p>
<p>Thanks</p>
<p>Melissa</p>
Find more posts tagged with
Comments
JFreeman
<p>Are you meaning the operating system level timestamp on the file?</p>
<p>What version of BIRT are you using?</p>
mwallis
<p>Yes, the operating system time stamp. I'm using BIRT 3.7.0</p>
JFreeman
<p>You can use the java.io.File package within the report design (somewhere like beforeFactory) to get the modified date of the file you have set for your data source.</p>
<p> </p>
<p>For example:</p>
<pre class="_prettyXprint _lang-">
var file = new Packages.java.io.File("C:/path/to/file.txt");
var modifiedDate = new Date(file.lastModified());
</pre>