Java time stamp

Hello All,
I want to create a TimeStamp Object.
I was using the constructor
TimeStamp s = new TimeStamp(2001, 07, 07, 0, 0, 0, 0);
Problem is that this constructor is now deprecated.
The new constructor takes a value of type 'long'.
But I don't know what to put in this long ?
Can anyone help?
regards,
Abhishek.

I know that new TimeStamp(System.currentTimeMillis()) would work but that is not what I want.
I do not want the current time.
I want to create an Time stamp object with the time
2001/07/07 00:00:00
regards,
Abhishek.

Similar Messages

  • Update file date/time stamp using java

    Let me explain you what I am going through:-
    I have created a java based installer using Jexpress tool and after I do the installation of my files, the files takes the current date rather then taking the date when it was created or modified.
    Everything goes into JAR and I heard that Jar file do not retain the date/time stamp of the file.
    I would like to know if we can change the date and time stamp of the files using Java.
    Is there any method to do that or can we do this by writing the java class?
    Thank You
    Mehul

    Did you check it?
    I did.
    $ jar cvf ~/ui *.m3u
    added manifest
    adding: Amollhgv.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand1.m3u(in = 56) (out= 27)(deflated 51%)
    adding: Brand2.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand3.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand4.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand5.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand6.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Edurhgv.m3u(in = 42) (out= 24)(deflated 42%)
    $ unzip -l ~/ui
    Archive:  /home/ijbalazs/ui
      Length     Date   Time    Name
            0  12-04-03 17:53   META-INF/
           71  12-04-03 17:53   META-INF/MANIFEST.MF
           42  08-26-02 01:03   Amollhgv.m3u
           56  11-22-98 01:15   Brand1.m3u
           42  08-26-02 01:04   Brand2.m3u
           42  08-26-02 01:04   Brand3.m3u
           42  08-26-02 01:04   Brand4.m3u
           42  08-26-02 01:04   Brand5.m3u
           42  08-26-02 01:04   Brand6.m3u
           42  08-26-02 01:04   Edurhgv.m3u
          421                   10 files

  • GetSelectedFields()  for time stamp and user stamp using java api

    using Java API's
    getSelectedFields() returns NULL  value if values presented also, for Time stamp and User stamp
    properties in Flat tables , is there any other alternative way to get the SelectedFields values ?
    Edited by: Vijaya Sekhar Reddy Alla on Mar 19, 2008 3:16 PM

    Well, I can't say I solved the problem, because I got another one afterwards.
    As usually I created a GetFieldListCommand, set its needed attributes and executed it. Then I read all the field properties out:
    FieldProperties[] fieldProp = getFieldListCommand.getFields();
    Afterwards it is possible to do what you want. Using a for-loop.
    for (FieldProperties fp : fieldProperties) {
        UserStampFieldProperties usfp = (UserStampFieldProperties) fp; // <= Cast error
        FieldId[] fieldIDs = usfp.getSelectedFields();
    And this is what I get now:
    Exception in thread "main" java.lang.ClassCastException: com.sap.mdm.schema.fields.FixedWidthTextFieldProperties cannot be cast to com.sap.mdm.schema.fields.UserStampFieldProperties
    Why this happens, I don't know. But it should somehow be solveable.

  • GMT time stamps interfere with calendar in 8.1.2

    How do I prevent GMT time stamps from interfering with my calendars? This did not occur until I upgraded to OS 8.1.2
    I sync an iPod touch 5th generation with google calendars, and have done so with this device for over a year, and on a generation 3 device for four years - all without hassle. 
    Since upgrading to 8.1.2 my calendar is suddenly very difficult to use.
    -Chris

    Sushil,
    Please post this question in the Workshop 8.1 beta newsgroup.
    weblogic.developer.interest.81beta.workshop
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.developer.interest.81beta.workshop&utag=
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Sushil" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi All,
    I am trying to develop JSP client for a conversational webservice. I amtrying
    it in two ways and
    none of them is working.
    1)
    I have put the Java Proxy file generated by Weblogic Workshop for myWebservice
    in the lib
    directory of the web application. According to article posted in "DearJohn" series,
    my proxy
    must have methods that take one additional argument to pass in Header infoapart
    from all
    the arguments mentioned by me. But, I don't see any methods like this inmy proxy
    and
    corresponding stub.
    2)
    Other suggested method is to use Webservices Control. In this, I amsetting a
    string as
    Conversation ID when I invoke a method that is marked to startconversation. Further,
    if I
    invoke any other method marked Continue in the same JSP it works. But,from another
    JSP
    where I set the same conversation ID and then try to call a method markedas Continue,
    it does not work. It say, check whether you have start a conversation. Ican see
    my conversation
    in Test browser and I am calling continue method before max-idle-time.
    I am not sure which step I am missing. Help Required!!!
    Thanks in advance,
    Sushil

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • IDOC number should be passed with Time stamp

    Here the scenario is IDOC to File.
    Currently I am getting the date and time stamp but I want to pass the IDOC number after the torr_asn_20080522-010137-257.txt
    torr_asn_?_20080522-010137-257.txt
    Here in place of question mark I want to pass the IDOC number and how to pass
    Let me know quickly as the issue is very urgent.
    Points will be awarded.

    Hi Arjya,
    If your requirement is to create , the file name dynamically for your receiver file adapter, you can do so using your FILE ADAPTER CONFIGURATION itself, and need not go for any JAVA Mappping / Java Code at all.
    *The dynamic filename generation concept is as follows.8
    In your filename field in the receiver file adapter, just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    Also, in your FILE Adapter under the option FILE CREATION MODE, you have options like,
    1.Add Counter,
    2. Append
    3. Create
    4. Add Time Stamp
    Reward points if this helps
    Regards
    Pragathi.

  • Time stamp information in default trace file

    How to check the time stamp in defaulttrace.trc or application.trc files for logs in XI server.
    I have seen following timestamp in above mentioned trace  files. But seem to me, during the shutdown time of server, system put the timestamp in trace file.
    ERROR       gateway shutdown
    TIME        Fri Jun 20 11:01:08 2008
    Except for shutdown time, how the system put the timestamp for other activity of system in the default trace and application trace file??
    Sometime, i need to check the timestamp to get some specific information in default trace file for some system activities.
    is timestamp mentioned in coded form as per following log:
    #1.#36CC34C00F02009B000001B400001FF40004510B33EAB6D3#1215008464352#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.RFCDefaultRequestHand
    ler.handleRequest()#J2EE_GUEST#0##XQA#SAPSYS                          #4869A1FC78690A8DE10000000A2C0AC7#SAPEngine_Application_Thread[impl:3]_51##0#0#Error##P
    lain###java.lang.reflect.InvocationTargetException#
    #1.#36CC34C00F02009B000001B500001FF40004510B33EAB76C#1215008464352#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.RFCDefaultRequestHand
    ler.handleRequest()#J2EE_GUEST#0##XQA#SAPSYS                          #4869A1FC78690A8DE10000000A2C0AC7#SAPEngine_Application_Thread[impl:3]_51##0#0#Error##P
    lain###java.lang.reflect.InvocationTargetException
    Thanks
    Amar

    Hi Amarjit
    The timestamp is noted in unix epoch time (java does use this as well). It is this field:
    #1.#36CC34C00F02009B000001B400001FF40004510B33EAB6D3# 1215008464352 #com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.RFCDefaultRequestHand
    ler.handleRequest()#J2EE_GUEST#0##XQA#SAPSYS
    The first 10 digits are seconds since epoch. The last 3 digits are milisecondes. Converted in human readable format: 07/02/2008 16:21:04.352
    [Unix Time|http://en.wikipedia.org/wiki/Unix_time]
    Damn, i remeber having answered this already here in the forums, but i cannot find the thread anymore myself :-(((
    Best regards
    Michael

  • FileMonitor issue for date time stamp change.

    Hi I have an app that runs with a minor issue and I am looking for some insight for a workaround or code change.
    I have a File Monitor that checks a specific directory every second.
    Users send a batch run to this directory throughout the day. There are two types of files, .ZIPs and .DONEs.
    So for each .ZIP a .DONE is sent to notify the app it can begin to process the file.
    Here is what I receive
    /elements/process/File1.ZIP     Oct 15 08:19
    /elements/process/File1.DONE     Oct 15 08:19
    The problem I am encountering is sometimes the .DONE and. ZIP are sent and the date time stamp of both files are the same so when the monitor reads the directory it looks like there is no change so both files sit in the directory and do not process. To make this work, I usually go in and touch a file to change the date time stamp.
    This is a java app that runs on an AIX box.
    Here is my code, is there anything any once can suggest to help me out. Thanks in advance.
       * Subclass of FileMonitor, Handles the timer event
       * @param none
      private class FileMonitorNotifier extends TimerTask
        public void run()
          // Loop over the registered files and see which have changed.
          // Uses the Modifed DateTimeStamp to determine if there was a change.
          // Use a copy of the list in case listener wants to alter the
          // list within its fileChanged method.
            try
                Collection files = new ArrayList (hmFiles.keySet());
                for (Iterator i = files.iterator(); i.hasNext(); )
                    File file = (File) i.next();
                    long lastModifiedTime = ((Long) hmFiles.get (file)).longValue();
                    long newModifiedTime  = file.exists() ? file.lastModified() : -1;
                    //      Check if file has changed
                    if (newModifiedTime != lastModifiedTime)
                        //      Register new modified time
                        hmFiles.put(file, new Long (newModifiedTime));
                        // Notify listeners
                        for (Iterator j = colListeners.iterator(); j.hasNext(); )
                            WeakReference reference = (WeakReference) j.next();
                            FileListener listener = (FileListener) reference.get();
                            // Remove from list if the back-end object has been GC'd
                            if (listener == null)
                                j.remove();
                            else
                                listener.fileChanged (file);
            catch(Exception ex)
                 m_odLaunch.logError(OdIntegrationConstants.ERROR_LEVEL_MIDLEVEL, ex);
         }

    Yes, I guess you are right, I don't care what time each file came, as long as I have both I can being to unzip and process and delete the .DONE.
    The code itself was based on if a filechanged then do work.... I could just take this out. Thanks!
    * This is the main entry point when there is a change to the modified date/time
    *  of the monitor directory
    * @param file directory we are monitoring
         public void fileChanged (File file)
              StringBuffer sbMessage;
              try
                   sbMessage = new StringBuffer();
                   //Make sure this is a Directory
                   if(file.isDirectory())
                        //Return list of files with extension we are looking for
                        File[] arFiles = file.listFiles((FilenameFilter)new FileSuffixMonitor(m_odLauncher));
                        for(int i=0;i < arFiles.length;i++)
                             sbMessage.append("Found file association to move-" );
                             sbMessage.append(arFiles.toString());
                             m_odLauncher.logInstance(sbMessage.toString());
                             processMoveFile(arFiles[i]);
              catch(Exception ex)
              sbMessage = null;

  • Date time stamp to be converted into only date

    Hi Experts,
    when i am using substirng functoin for converting datetimestamp to date it is giving the following error
    i am using RNIF pip to be converted into IDOC ORDERS 05
    the time stamp value from pip should modified in that so that i can get only the date
    by elemiting the time asscioated with it so i used substring functoin it is giving following error
      /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8 at java.lang.String.substring(String.java:1441) at com.sap.aii.mappingtool.flib3.TextFunctions.substring(TextFunctions.java:33) ... 26 more RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499]
    thanks
    sunil

    Hi,
    Do as follows.
    Use standard date transformation function.In that format of source date give as hh:mm:ss ddMMyyyy and format of targeet date as you wish..It wil solve.
    Please award marks if found useful.
    Thanks
    Hamja

  • Adding time stamp to the field

    Hi,
    All
    I need to pass the Current Date and Time Stamp to the Target Field
    For Current Date there is a Standard Function Is There ,For Time stamp Is there any Standard Function is there or we Need to write write UDF ,if we need to write to UDF Please provid Java Code for that.
    Marks is awardble
    Thnx in advance
    Regards
    kumar

    Hi,
    Using this java code you can get both Date and Time...
    import java.util.Date;
    Date d = new Date();
    return d.toString();
    The format returned will be like this "Tue Dec 26 12:15:24 IST 2006"
    To change the format, you can use get methods( getDate(), getHours() ) of Date class and concatenate them.
    Regards,
    Uma

  • Time Stamp via Custom Function

    This is such a basic concept for a custom function that I am assuming someone out there has done it already. I have never created a custom function for Essbase, though I have programmed in a variety of languages and I'm assuming getting the current date/time in Java is not exactly rocket science. I have reviewed the docs for creating and registering custom functions and that also appears relatively simple, especially with the examples available.<BR><BR>What I want is a function that returns a Double in the form of a Date/Time that I can retrieve into Excel and display as a Date/Time. We want a simpler, more effective way of time stamping the running of calculations, more effective than combing through the app logs when we need to know if/when a calc ran a week or a month or two ago.<BR><BR>Does anyone have some sample code and/or insights to share on this topic? I would greatly appreciate it if you do.<BR><BR>Thanks,<BR><BR>James

    fyi - I ended up implementing a solution in Perl/Maxl that gives a timestamp to the second in a format that can be retrieved intelligently into Excel. I use the Perl time() function (Unix server) to get the GMT epoch time as a long int. Then I convert it into the floating point DATE format for Windows, with the hard-coded assumption of what time zone my server is in. Then I run a calc from MaxL that sets this value. I build the calc string in Perl and pass it into MaxL. Pretty cool. The calc uses two sub vars, one for the members to fix on and the other for the Scenario to timestamp. This way the perl/maxl is database independent.<BR><BR>Just thought someone might want to know...

  • Get the created time stamp of a file...

    Hi Guys,
    I am trying to get the created time stamp of a text file from oracle... How is this possible? I tried using UTL_FILE but didnt succeed so....
    Thanks...
    Edited by: Napster on Oct 21, 2010 12:43 AM

    You may try something like this.
    create or replace and compile java source named filehandler as
    import java.lang.*;
    import java.util.*;
    import java.io.*;
    import java.sql.Timestamp;
    public class FileHandler
      private static int SUCCESS = 1;
      private static  int FAILURE = 0;
    public static Timestamp lastModified (String path) {
        File myFile = new File (path);
        return new Timestamp(myFile.lastModified());
      }Then the wrapper
    CREATE OR REPLACE FUNCTION lastModified (p_path  IN  VARCHAR2) RETURN DATE
    AS LANGUAGE JAVA
    NAME 'FileHandler.lastModified (java.lang.String) return java.sql.Timestamp';PS: Not tested.

  • Time stamp in server logs

    Hi,
    I am using WLS 8.1 and 9.2, the defalt time stamp format in server logs contains the following format:-
    hh:mm:ss, can we change the time stamp to include milliseconds also, if yes then how?
    Thanks in Advace,
    TK.

    That's only for the access log format, not the server log, and it only controls which additional elements can be displayed. It is possible to add custom fields by adding Java code, but again, that's only for the access log.
    As I said before, when you asked this before (I don't know where I saw you ask this before), it's really not practical to alter the server log timestamp format. You're better off writing your own log messages with your millisecond timing.

  • How can i get todays date as an yyyy-MM-dd format instead of Time stamp

    how can i get todays date as an yyyy-MM-dd format instead of Time stamp,i try to do it in the fallowing way
    <code>
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
         java.util.Date d = new java.util.Date();
              String s = d+"";
    Calendar cal1 = Calendar.getInstance();
         try{
         cal1.setTime(sdf.parse(s));
    }catch(Exception e){}
    </code>
    but i could not able to get,it throws error as an java.text.ParseException: Unparseable date: "Thu Jan 24 11:43:32 EST 2002" ,pl suggest me any solution.any help would be appreciated.
    Regards.

    Does string s have to end with ""?
    Try doing sdf.format(d) instead.

  • Windows File Time stamp

    Hello!
    From my understanding there is a File class which has several methods e.g to get file name. The problem i am having is I am trying to implement a simple program which looks at the time file stamp and output the creation, access and modified times of a file; so far I have been able to retrieve the last modified time of a file but not the access and creation times. How is this done? below there is code to retrieve last modified time:-
    ===================================================
    package timestamp;
    import java.io.*;
    import java.util.*;
    public class Main {
    public static void main(String[] args)throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter file or directory name : ");
    File filename = new File(in.readLine());
    // check to see if its a directory
    if (filename.isDirectory()){
    // check to see if its a file
    if (filename.exists()){
    long t = filename.lastModified();
    // get a directory name
    System.out.println("Directory name : " + filename.getName());
    System.out.println("Directory modification date and time : " + new Date(t));
    else{
    System.out.println("Directory not found!");
    System.exit(0);
    else{   // check to see if the file name exists
    if (filename.exists()){
    long t = filename.lastModified();
    System.out.println("File name : " + filename.getName());
    System.out.println("File modification date and time : " + new Date(t));
    else{
    System.out.println("File not found!");
    System.exit(0);
    }

    Hi! thanks for the response I have written the code to retrieve the creation, access and modified times using Run exec (). A user enters file or directory name and idealy it should output those times. When i run the program I get IOException error=2..... a lot of articles online suggest the error means that the files is not found but the file I have specify does exist unless the my coding is wrong. Any suggestions:
    C:\>java Times
    Enter file or directory name:
    C:\Dev-C++
    exception happened :
    java.io.IOException: CreateProcess: "dir \tc" "dir /ta" "dir /twC:\Dev-C++" error=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at Times.main(Times.java:23)
    source code
    import java.io.*;
    public class Times {
    public static void main(String args[]) {
    String s = null;
    try {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter file or directory name: ");
    File filename = new File(in.readLine());
         // run windows command in conjuction with entered file/directory name
         // creation time "dir /tc"
         // access time "dir /ta"
         // modifed time "dir /tw"
         String [] times={"dir /tc", "dir /ta" , "dir /tw" + filename};
    Process p= Runtime.getRuntime().exec(times);
    //Process p= Runtime.getRuntime().exec("dir /tc" + "dir /ta" + "dir /tw" + filename);
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("The output:\n");
    while ((s = stdInput.readLine()) != null) {
    System.out.println(s);
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
    System.exit(0);
    catch (IOException e) {
    System.out.println("exception happened : ");
    e.printStackTrace();
    System.exit(-1);
    }

Maybe you are looking for