Readind Date and Time from a folder.Urgent help please

Folks,
I need some help regd reading of date and time from a folder.
I have a folder which has 5 files.
I need to read these files along with the date and time
The date and time has to be in the format:
mm/dd/yy and the time in 11:55
I am attaching my code below,
The f.lastModified() doesnt display the data in the current format
Can some one please please help me to get the data in the format defined above
private void readFoldert(){
   String folder = "/images/";
   File f1 = new File(folder);
   ArrayList al = new ArrayList();
    if(f1.isDirectory()){
     String s[] = f1.list();
      for(int i=0; i<s.length;i++){
         al.add(s[i] + f1.lastModified);                    
} // End of if.
       

Here's how to format a time. I hope you can figure out how to format a date:import java.text.*;
import java.util.*;
public class Test {
    public static void main (String[] parameters) {
        Calendar calendar = new GregorianCalendar ();
        calendar.setTimeInMillis (new java.io.File ("c:\\windows").lastModified ());
        System.out.println (DateFormat.getTimeInstance (DateFormat.MEDIUM).format (calendar.getTime ()));
}Kind regards,
  Levi

Similar Messages

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • Is there a way to remove the date and time from pictures?

    Is there a way to remove the date and time from phoos in iPhoto?

    Are you referring to the Date and Time some cameras put right on the image?  If so there is nothing really good in iPhoto to do this. You could try the Retouch tool and see how that looks but I think you will need something more precise and powerful, like the clone tool in Aperture.
    Also something like PhotoShop or GIMP - The GNU Image Manipulation Program (free) should do what you want also.
    If your asking about some other date post back.
    regards

  • Date and time from array of string

    I have managed to read information from an excel spreadsheet I am using and display different parts of it in indicators on my front panel. But the data being displayed for the cells that contain the date and time are showing up incorrectly.
    The date of 15/08/2014 shows in the indicator box as 41866 and the time of 13:55:00 shows as 0.579861111111111
    Is this something I need to change in the excel file or do I need to alter the data in the array before displaying it in the indicator.
    Sorry if this has been explained in the past. I just cant seem to see a previous solution.
    Thanks in advance

    Hi n,
    please search for your problem in the forum. This has been discussed a lot of times before! (keywords: Excel LabVIEW timestamps)
    Excel stores timestamps as number of days (your 41866) and part of days (0.5798d = 13H55M). You need to convert those numbers using some (more or less) simple math to LabVIEW timestamps!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Get the date and time from iframe.

    Hi,
    Am using jdeveloper 11.1.1.6.0., I have used the following iframe source which gets the date and time.
    <af:form>
    <iframe src="http://free.timeanddate.com/clock/i3xb4nm0/n1722/tt0/tw0/ts1" frameborder="0" width="244" height="19">
          </iframe>
    </af:form>
    I need to get the date and time separately to perform some validation. How can i  get it.
    regards,
    Prasad K T,
    9840021070

    Prasad,
    I don't understand your use case. The url you use is a json web service which returns it's result as either xml or json payload. Why do you pretty print this as a web page and try to get to the result this way?
    Why don't you get the result directly using the json result or (AFAIK) the java script api which the service also provides.  Check the documentation of the service.
    From your description I understand that the user enters a time. You need to know if the time is before or after 2:30pm and have to set a 'shift' to A or B.
    Where do I need a timeservice in this validation?
    From what I see your approach won't work. As I still don't understand the use case I don't know how to help.
    Timo

  • How to prevent calendar from deleting dates and times from event names?

    Calendar automatically discards date and time information from titles of new events. For example, creating a new event with the text "Staff Meeting 9 a.m. board room" leaves only "Staff Meeting". Calendar discards the "9 a.m. board room" information without asking. This feature is not helpful to me. How do I disable it?

    >
    Apple Support Communities > Mac OS & System Software > OS X Mountain Lion > Discussions

  • Getting the date and time from NIST server

    I need to be able to get the date and time in an app and cannot trust the device's clock since the user could change it. Has anyone got an example of how to access an Internet time server such as the NIST servers from AIR for iOS?

    What is the best way to get the date and time?
    ThanksI am not sure that this is the best way. But one of the ways.
    <code>
    java.util.Date d = new java.util.Date();
    System.out.println("date is "+d.toString());
    </code>

  • How can I display the date and time from the playhead info as a subtitle ?

    Is there any way it is possible to display the video capture data and time during playback. I have seen some discussion on creating subtitles to do this, it would be nice if one could simply add a Title template with display fields for playhead information so that it automatically gets created during rendering.
    In case you are wondering why on earth anyone would want this, I would like to use this for display on multisport racing videos.
    Thanks

    There is a Date/Time title in the titles browser, does just what it says...

  • Integration with Outlook - how to increment end date and time from start date/time

    Hi,
    I want to add a variable amount of time to an appointment start date and time in outlook, through vba in access.  Code below shows what I've done:
    ======================================
        Dim olApp As New Outlook.Application
        Dim olAppointment As AppointmentItem
        Dim myRequiredAttendee As Outlook.Recipient
        Set olAppointment = olApp.CreateItem(olAppointmentItem)    
        With olAppointment
            .Start = DateValue(strStartDate) + TimeValue(strStartTime)
            .Duration = intDuration
            .End = DateValue(strStartDate) + ????????
    =======================================
    What do I replace the ????? with so that it increments the start time by any duration I decide in minutes?  Using the duration doesn't seem to work and I also want to be able to have the appointment span a number of days, e.g. could start at 930am on
    Monday and end at 10am on Weds, but want to set the end time relative to the start time.
    Thanks,
    Chris.
    _________________________________________________________ Every day is a school day!

    I've tried that, but it throws out a datatype mismatch error :(
    It would be helpful if you posted the exact code you tried.  In my tests, setting teh .Duration property appears to work.  However, if you want to set the .End property to a specific number of minutes after the date/time of the .Start property,
    this works for me:
    With olAppointment
    .start = DateValue(strStartDate) + TimeValue(strStartTime)
    .End = .start + TimeSerial(0, intDuration, 0)
    End With
    Assuming, that is, that intDuration contains the number of minutes the appointment should last.
    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

  • Date and time difference for weekdays - urgent

    Hi,
    Is there any fun.module which will caluculate the difference between two dates and time  excluding weekends?
    Thanks in advance.
    Srini.

    Hi,
    Refer to the following link:
    http://sap-img.com/abap/function-to-return-next-business-day.htm
    Hope this helps.
    Reward if helpful.
    regards,
    Sipra

  • Can I remove the date and time from an image taken on my Powershot SX510 HS for printing?

    Natalie1, Once the photo is processed in the camera with the date stamp, it's permanent to the photo. The camera will not have that as a layer to turn off and on at will. It's much easier to add the date/time stamp to a shot for printing then it is to remove it. You will need some editing software such as Photoshop Elements, or Gimp (free), to remove the date/stamp. These software's can do a pretty reasonable job to remove any unwanted elements from the photo. Canon also has their Digital Photo Professional software that comes free with the camera, but it's not as easy to get the nice results of the Photoshop Elements. The change you make with these software's will remove the date/time stamp unless you only mask (layer) it. Steve M.

    Natalie1, Once the photo is processed in the camera with the date stamp, it's permanent to the photo. The camera will not have that as a layer to turn off and on at will. It's much easier to add the date/time stamp to a shot for printing then it is to remove it. You will need some editing software such as Photoshop Elements, or Gimp (free), to remove the date/stamp. These software's can do a pretty reasonable job to remove any unwanted elements from the photo. Canon also has their Digital Photo Professional software that comes free with the camera, but it's not as easy to get the nice results of the Photoshop Elements. The change you make with these software's will remove the date/time stamp unless you only mask (layer) it. Steve M.

  • Help! How to retrive the date and time from MySQL 'datetime' type

    In my MySQL database, I have stored a data type 'DATETIME' as 20070412093012 which is interpreted as 2007-04-12 09:30:12, How to using Java method to retrive it from data base???
    like resultSet.getDate('datetime')????or what is the method?

    Have a look at the API documentation for ResultSet. Which of the methods documented there do you think might be what you need? If you can't tell which is the right one, then post your candidates here and ask a question about them.

  • Retrive due date and status from task folder in Exchange server

    Anyone to know how to access the data in task folder through java from Exchageserver

    Thanks morgalr. If u have any sample code for JNI plz send it to [email protected]
    Advance Thanks.

  • Filter on date and time from Live Office query panel (Excel)

    Hi,
         I'd like to know if someone already tried this.
    1- Create a univers with 3 fields.
    a. Field 1 type date: points to a type date field (ex: 2011-12-31 00:00:00)
    b. Field 2 type date: points to a type time field (ex: 17:00:00) -> which is basically 5pm
    c. Field 3 type date: points to a type datetime field (ex: 2011-12-31 17:00:00)
    2- Open Excel and using Live Office plugins
    3- Open the univers
    4- Drag the Field 3 as filters.
    5- Choose an operator ex: Between, Greater, etc.
    6- Open the calendar and select a date
    7- Modify the 00:00:00 to put something like 17:00:00
    8- Click away
    9- The time resets back to 00:00:00
    So my question is how do I have to setup the field in the univers so that we can query on the time using the univers in Live Office.  I say Live Office because in WEBI, it works fine.  Changing the 00:00:00 to something else doesn't make it reset to 00:00:00 when you click elsewhere.
    Trying with Field 1 and 2 does the same thing.
    Purpose of this is to be able to filter on parts of the day, like am (8am to noon) and pm (1pm to 5pm).
    BOXI 3.1 SP3
    Windows Server 2008 R2
    Netezza database
    Live Office 3.1 SP3 (Client)
    Excel 2007 (Client)
    Windows 7 (Client)
    Thanks,
    Edited by: Sing Phommavong on Feb 23, 2012 11:24 AM

    Hi n,
    please search for your problem in the forum. This has been discussed a lot of times before! (keywords: Excel LabVIEW timestamps)
    Excel stores timestamps as number of days (your 41866) and part of days (0.5798d = 13H55M). You need to convert those numbers using some (more or less) simple math to LabVIEW timestamps!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I-TUNES LIBARAY FOLDER - URGENT HELP PLEASE!!!!!

    Hi,
    I am running VISTA.
    I have all my I-TUNES Libary music in folder on my External Hard drive, so it make's It Easier for if i ever swap my computer.
    Im having a bit of a problem.
    Even tho I have Pointed I-TUNES at my EXTERNAL HARD DRIVE and have ensured that Itunes is Ogernized. It appears that I have music in other Places on my computer for some Reason.
    Can any-one tell me,how I make sure that all my Music is in ONE, folder on my external hard drive??????
    MY under standing is that if i create a folder on my External hard drive then point I-TUNES AT THAT FOLDER THEN ConsolidaTE....is this teh right thing to DO ?
    And when i IMPORT A CD for example, that the Music goes to the I-TUNES folder rather than some wHere else on my Compter

    That shouldn't happen, normally consolidate is safe.
    Check that the location of your iTunes Music folder is correct. i.e. is is set to the folder when you put your music.
    If you ever start iTunes with the drive disconnected or otherwise unavailable, iTunes will go back to the default location for your iTunes Music folder on the c: drive.
    Is it possible that that happened, it seems the most likely cause of the problem.
    If that's not it. Check your new Music folder to see if your files really are there.
    Then you can check where iTunes thinks they are by opening iTunes Library.xml with WordPad.
    Look for lines starting:
    <key>Location</key>
    These contain file paths, but the space character is replaced with %20.
    Check a few of those, that's where ioTunes thinks your msuic is located.

Maybe you are looking for