File date and time

how to retrieve the information about the date and the time of a file.
I want to identify my files with
filename + date.toString() + time.toString()
It because some files may have the same name, but different date and time
thanks in advance for it,
Felipe

File myFile = new File(path);
long time = myFile.lastModified();
// convert time to date and tme

Similar Messages

  • How to get local file date and time ( 10g version )

    Hi,
    Would like to ask if there is any way to get the date and time of a local file. It seems that webutil does not have this function.
    And I want to use client_host ( dir c:\file.txt > c:\temp.txt ) and the read this file to get the file date.
    But the problem is the file date and time ( in the dir ) varies in different PCs.
    Best Regards,
    Ivan

    But the problem is the file date and time ( in the dir ) varies in different PCs.
    You mean the format of the date and time don't you?
    If so you maybe could create a java bean which does that for you using the lastModified Method of the File class.
    regards

  • Ack file date and time format is same as in source xml format

    Hi...All,
    1) my scenario is file-rfc-file using BPM,
    we are getting file in xml format from source along with timestamp and this data will be going to R/3 and the acknowledgement (success or failure) file will be sending back to source system.
    in this sceneario we have to fulfill in the follwing client requirement
    File1.<same File1 date and time>.XML
    Is it possible to make it as the following? if it is possible
    could u please let me know how to fulfill the follwing requirement.
    ACK File1.<same File1 date and time>.XML
    Where <same File1 date and time> format = u2018YYYYMMDDhhmmssu2019 .
    2) Is the XML file name visible in the SAP-XI monitoring screen and will it help to trace the messages?
    thanks in advance,
    Pasi.

    Hi,
    I didnot under stand your first question coulf you be more specfic.
    2. Ans : In general , we will follow the below steps
    --First we we check for the file is picked or no, if not see the Sender side CC parameters like mode and path details
    --If file was picked then we need to check whether we are using the File content conversion parameters or not if yes we need to check the FCC parameters ,
    Goto RWB-Channelmonitoring by the following link
    http://host:port/mdt/channelmonitorservlet
    select the sender side CC name and check for errors
    If no errors in above, goto SXMB_MONI for Integration Engine xml processing , check for successful or error occured black or red color
    --if success in SXMB_MONI then we need to check in RWB as above channel monitor now select the receiver side CC
    If no errors then check for output file is placed intarget or not
    Please reward points if it helps
    Thanks
    Vikranth

  • Lightroom changes file date and time

    When I imported a large number of images to Lightroom, keeping the files in their original location, the dates and times of the files were updated. This is a bit of a pain because it means that about 4000 files will now be backed up again to the online backup service I use. Why does LR change the filedate when all it's doing is importing to the library?

    > Alexander wrote: I believe you have set the option to "Automatically write changes into XMP" and are working with non-raw files (jpeg, tiff or dng)? In this case it is the expected behaviour as LR will write any metadata changes right into the files, thus changing the modification date of the image files.
    Either uncheck the above mentioned preference setting or beg Adobe to bring us back xmp side car files for jpeg, tiff and dng.
    No, I'm not stalking you :)
    The following applies to Macintosh OS X, 10.4.8. I don't know if the same happens with Windows.
    I had a similar problem when editing some JPEG file from my Fuji F30. When I would Export the metadata the 'Modified' date of the file changed as expected. However, for certain files, the 'Created' date also changed. I opened a case with Adobe, sent them a description of the problem and some sample files. The Technical Support person reproduced the behavior and passed the information to Engineering.
    Yes, Adobe, give us XMP files for all files.

  • NI unzip changes file date and time stamp

    A coworker this morning asked me about the NI-Unzip VI.
    It turns out that when the NI unzip VI unzips a file it changes the file dates to the date the file was unzipped.
    He also noted that NI-Unzip seems to be calling the Windows touch.exe to do this.
    The diagram for NI unzip is locked and password protected so his attemp to change this action blocked.
    Does anyone know a way around this? Either to make the NI Unzip stop changing the file date or the passwork to teh unzip vi?
    Message Edited by RTSLVU on 03-22-2010 08:01 AM

    Hi,
    I don't think NI will give you a password for it's protected functions...
    So you can:
    - use "System Exec" with a command line version of a ZIP tool of your choice to unzip files
    - make your own "Unzip" VI with calls to a "unzip"-DLL of your choice
    Choose the one that is easier to implement for you
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Ftp get file with original date and time on one server to another server

    Dear All,
    I have successfully file copied from ftp server1 to ftp server2 but i cant get original file date and time.If anyone knows please help me...
    i have using the package is sun.net.ftp.FtpClient .
    Thanks
    Andavar.P

    Use the Apache commons-net library which has an excellent and easy to use FTP API, properly documented too.

  • Date and Time in Sender File Adapter Target Directory

    Hi there,
    is there a way of using Date and Time from XI to the Target Directory naming? To use variable substitution some fields of the message had to contain that date and time information, which is not our case.
    For filename you can use "add time stamp" option, but and for target directory?
    Thanks and regards,
    Henrique.

    > <i>Do you have further information on how to perform
    > this with shell commands?</i>
    > >> You need to write a shell script. This script will
    > add the date/time stamp into the folder in the target
    > system. This shell script is executed from the File
    > adapter. So once the file is written into the target
    > directory, then it will rename the directory.
    Hi there, Moorthy
    We've tried to write that shell script that you mentioned, but now we have a few doubts on how to make it create the proper directory.
    In the file adapter, my target directory is "/%var1%/%var2%/", where %var1% and %var2% are variable substitutions, referencing data which comes from the payload. Now, I need the shell script to append "/<Year>/<Month>/" in the target directory. But where to archive the script? If it stays in the root directory, than how to make it create "/<Year>/<Month>/" folders inside a directory which is variable (/%var1%/%var2%/)?
    Is there a way of passing %var1% and %var2% as parameters for the shell script?
    Thanks a lot,
    Henrique.

  • Need help in using SQL in a jsp file to compare date and time

    hi every one,
    Actually I am doing a project using JSP. I need to compare a date field in the database (MS Acess) to the current system date and time. I have to do this in a select statement.
    I have alredy defined a variable of type Date in the JSP file and I am comparing this variable to the date in the database through a select statemant.
    Here is what I am doing
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
              java.util.Date today = new java.util.Date();
              String myDate=sdf.format(today);
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= "+myDate+" ;";
    EDate is the feild in the database and it's format is (5/12/2008 5:29:47 PM) it is of type Date/Time in MS Acess.
    when I execute the query it gives the following error
    SQL error:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'EDate <= 2008-10-16 08:10:07'.
    I hope any one can help me with that error and answer my question, I've tried too many things but nothing helps
    Thanks in advance :-)

    Hi,
    When the comparision is needed to be done with the current date , we don't need to send in Java
    Date then format it and compare with MS Acess Date.
    In MS Access we have Date() function which will give you the current date.
    So you can try rewriting your query as following :
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= Date() ;"; ---------------------
    Hope this helps.
    Thanks

  • 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.

  • How can i change date and time after importing a file

    hello
    i'm importing AVI files first in iMovie because Final doesn't support (other question i put in) but when i see the scenes form 1993 they have the date 2004.
    i believe 2004 is the date i put them on the computer.
    Now i looked in the help files Final Cut Pro but cant find anything to adjust the date and time.
    it works well in iMovie using the help files:
    Right-click the clip you wish to edit and click Adjust Clip Date and Time from the menu that appears. Or click on Archive and than adjust date and time
    But as i said i cant import the files in FCP have to import them to  iMovie files adjust the date and than import to Final Cut Pro but than de changes i made to the date and time  are gone and in FCP 2004 is again the date of the file!!!
    Question how can i Change in Final Cut Pro the date and time in a same way as iMovie does?
    Jemajoro

    OK, I think I understand what you are saying but it still does not look like it is doing it as you describe.
    Here is another screen shot.
    Note that all clips in "2007 August" event have the date of Aug x, 2007.
    Yet, the event "2007 August" still shows up under the 2012 "folder" (is that the right terminology?).
    The newest clip in this event is Aug 31, 2007 so shouldn't it be categorized as 2007 and not 2012?
    I think you know this but I am using the following feature:
    Go to the sprocket icon under the events.
    Select "Group events by date" and then by "group events by year and month"
    Thanks again for all the help

  • How to get the most current file based on date and time stamp using SSIS?

    Hello,
    Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS?
    Thanks
    thx regards dinesh vv

    hi simon
    i excuted this script it is giving error..
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    namespace ST_9a6d985a04b249c2addd766b58fee890.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            The execution engine calls this method when the task executes.
            To access the object model, use the Dts property. Connections, variables, events,
            and logging features are available as members of the Dts property as shown in the following examples.
            To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
            To post a log entry, call Dts.Log("This is my log text", 999, null);
            To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
            To use the connections collection use something like the following:
            ConnectionManager cm = Dts.Connections.Add("OLEDB");
            cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
            Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
            To open Help, press F1.
            public void Main()
                string file = Dts.Variables["User::FolderName"].Value.ToString();
                string[] files = System.IO.Directory.GetFiles(Dts.Variables["User::FolderName"].Value.ToString());
                System.IO.FileInfo finf;
                DateTime currentDate = new DateTime();
                string lastFile = string.Empty;
                foreach (string f in files)
                    finf = new System.IO.FileInfo(f);
                    if (finf.CreationTime >= currentDate)
                        currentDate = finf.CreationTime;
                        lastFile = f;
                Dts.Variables["User::LastFile"].Value = lastFile;
                Dts.TaskResult = (int)ScriptResults.Success;
    thx regards dinesh vv

  • HT1382 how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    What backed up files?
    Available backups for an iOS device can be found in Edit > Preferences > Devices.

  • How to get last modified date and time of a file which is in apache server.

    Hi ,
    I need to get last modified date and time of a file in remote machine.
    This file is in remote machine which has apache server installed.
    I am trying to get this information by connecting to apache server from client by giving absolute URI of the file to file object.
    URI is got from apache server URL by using toURI method.
    when I use lastModified method , its throwing exception , because scheme of URI is not file.
    I can't give scheme as file because ftp server is not installed on that server
    Is there any other way to get this information .

    No, unless you can use an FTP client.

  • Get-Content and add Date and Time in a new file

    Hello,
    in a existing file I have data like:
    1;Idle
    5;chrome
    1;spoolsv
    Now I need to grab the content and add date and time in front of each line and save it to another file like:
    07.04.2015;10:18;1;Idle
    07.04.2015;10:18;5;chrome
    07.04.2015;10:18;1;spoolsv
    But I don't have any idea how I could solve this challange. Does anyone have a helping hand for me?
    Greetings

    Hello,
    If you need a new file with the desired output try this
    get-content .\current.txt | Foreach-Object{ $dntv = (get-date) ; "$dntv" + $_} | Out-File newfile.txt
    regards,
    V
    Venu

  • Inserting automatic file name, date and time in Illustrator CS3?

    hello all,
    is there an option in Illustrator where you could automatically insert inside your file the file name, date and time where it was last created or modified, etc.
    I found this option to exist in InDesign, but could not find the same menu in Illustrator. I am using CS3.
    help?
    thanks a bunch.

    Mario,
    would you please be so kind to include a reference on your site about the script? As far as I can see, the PutDateandTime.js you are providing here is a copy or a slightly modified copy of the original script that Wolfgang Reszel has provided on our site for about four years.
    It is okay that the script is available on your site, but please not without a reference. Thanks.

Maybe you are looking for

  • Adding Data in the grid

    One thing I am finding a little awkward; Adding data in the grid. It would be nice to be able to use tab to get to the next cell. At present it just highlights the cell and typing doesn't do anything until the cell is clicked. Equally hitting return

  • Metric threshold and Response Action

    Hello, I have a problem regarding the metric thresholds in Oracle 10gR2. I would like to set a response action for the "Tablespace full in percent"-metric, but until now I wasn't successful with that. I tried the following steps (sorry, if I sometime

  • Error on a input ready query

    Hello SAP Gurus, Can anybody advise on the following error of an input ready query? u2022 Error reading the data of InfoProvider ZIPNA002 - Notification Number DBMAN 305 u2022  Error while reading data; navigation is possible - Notification Number BR

  • Sync problem with iPod Touch

    I downloaded episode #1 of a tv show to my iTouch. Then I purchased the season of the same show, and downloaded it to my imac. This download included Episode #1 again. My iTunes folder correctly shows Episode #1 only once. However, when I sync my iTo

  • I have hundreds of plist lock file's at zero bytes

    In my home library Preferences folder, I'm seeing literally hundreds of plist files ending in "lockfile" - all taking up zero bytes.  Can I delete these? I have over 700 plist files in total, about 1/4 being these taking up zero bytes.  Anyone know w