Automatic file generation using system date and time

Hi guys,
Iam trying to generate a path for file creation automatically using System date and time. I am running into errors with respect to special characters in filename. I am trying to parse the string to get date and time without the '/' and ':' but have not been successful. is there a better way to do it? Please help! I am trying to avoid a dialog box for user to enter a filename.
Thanks!
V
I may not be perfect, but I'm all I got!
Solved!
Go to Solution.

here is a little experiment .... building the path out of %m (month) %d (day) %(year) type stuff might help.
Attachments:
putting time in path.vi ‏7 KB

Similar Messages

  • How to use system date and time

    Hi i am using mysql database.
    my code is import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpSession.*;
    import java.io.*;
    import java.sql.*;
    public class TaskA extends HttpServlet
      public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            java.sql.Date Taskdate = new java.sql.Date(System.currentTimeMillis());
            //long Time1 = System.currentTimeMillis();
            String UserName = request.getParameter("UserName");
            String Task = request.getParameter("Task");
            String Assignedby = request.getParameter("Assignedby");
            String Assignedto = request.getParameter("Assignedto");
            String status = request.getParameter("status");
            String Taskdesc = request.getParameter("Taskdesc");
            try
                 Class.forName("com.mysql.jdbc.Driver");
                 Connection con = DriverManager.getConnection("Jdbc:mysql://localhost:3306/sandeep?UserName=;Password=","root","digi");
                 Statement stmt;
                 stmt = con.createStatement();
                   ResultSet rs = stmt.executeQuery("select UserName from Empinfo where UserName ='" +UserName +"'");
                    if(!rs.next())
                         out.println("UserName may not valid ! u r Task was not Allocate successfully");
                   else
                        //rs.getString(1);
                   PreparedStatement st  = con.prepareStatement("insert into Taskinfo values(?,?,?,?,?,?,?)");
                 st.setDate(1,Taskdate);
                 st.setString(2,UserName);
                 st.setString(3,Task);
                 st.setString(4,Assignedby);
                 st.setString(5,Assignedto);
                 st.setString(6,status);
                 st.setString(7,Taskdesc);
                 st.executeUpdate();
                 out.println("<html>");
                 out.println("<body bgcolor =#cdcdb4 >");
                 out.println("your task sent successfully");
                 out.println("</body>");
                 out.println("</html>");
                   rs.close();
              catch(Exception e)
                   out.println("Driver is not found:    "  +e);
    }and afrer it get execute only date is store in database but not system time.but i want to store both date and time together.
    i am using DATETIME datatype in mysql.
    whats a problem in my code.

    You might want to use TimeStamp and not java.sql.Date which by definition does not include time.
    You might also want to close PreparedStatement and Connection in your code.

  • Extracting Time without using the System Date and Time

    Hi, can I know how to process a task at this particular time eg. 6PM everyday without using the System Date and Time..
    Do I need to use a Timer to get this done or is there any other solution to do this? Can give me a few hints? Thanks in advance =D

    You could use a timer...assuming you had some good reference point when you started so you would know that from your starting point it's now 6pm.
    I thought I saw you asked this question once already...and you were given a similar answer....I think by Sylviae?

  • Name of the file (in utl_file) with date and time

    Instead of the below:
    vHandle1 := utl_file.fopen('/home/oracle/testdir', 'test.csv', 'W');
    I want something like this:
    vHandle1 := utl_file.fopen('/home/oracle/testdir', 'test19dec200611.35.csv', 'W');
    i.e the name of the file should have the date and time too so that every time the original is not overwritten.
    Is this possible?

    OR maybe we can use this:
    utl_file.frename('/home/oracle/testdir','test.csv,'/home/oracle/testdir','test'||to_char(sysdate,'DDMONYYYYHH24:MI')||'.csv',TRUE);
    Will it work?
    Can we download this file and open it through oracle (and not any front end like ASP etc.)

  • How to pass system date and time with tabular from in Update only Mode.

    Dear Friends,
    i have created tabular form with UPDATE Only .here i am assigning work to another multiple users.i want to insert system date and time when i assign work to multiple users.
    How can i insert system date and time into table using tabular form in Update Only Mode.
    beacuse i have pass in default system date it's working only with add row button.
    How can i pass system date and time in update mode in tabular form.
    Thanks

    Hi,
    You just create a trigger on the table on which you build your tabular form:
    e.g:
    CREATE OR REPLACE TRIGGER  "AUDITING"
    before insert or update on "MYTABLE"
    for each row
    begin
        if inserting then
            :new.created_on := localtimestamp;
            :new.created_by := nvl(v('APP_USER'),user);
        elsif updating then
            :new.updated_on := localtimestamp;
            :new.updated_by := nvl(v('APP_USER'),user);
        end if;
    end;Regards,
    Fateh

  • Time Stamp Error: Cannot display system date and time. My VI display "YYYY-MM-DD" instead of "2014-08-02".

    Hi All,
    I am using Labview8.5 and Windows XP OS.
    My Problem is my Labview TimeStamp cannot display current system date and time.
    Please see my attachment for the screentshot.
    The TimeStamp or ever Format Date/Time String display "YYYY-MM-DD" instead of  "2014-08-02".
    I tried other computer machine and it works. There are some computer machine has this problem.
    How can I resolve this issue? Please advice. Thanks.
    Best Thanks,
    Jessie
    Attachments:
    Time Stamp error.JPG ‏68 KB

    Bill,
    reviewing the thread Dennis linked (thanks for that) reveals that it is the same account which opened this thread here three month later.
    What bothers me is the fact, that the past thread is marked "solved" even though it obviously isn't. Or the OP is trolling us.....
    Nevertheless, it seems like systematic error. Connected to specific machines.
    What makes the machines where the time stamp issue occurs "unique"? If there are several, is that source really "unique"?
    Most obvious reasons would be:
    - Language settings (possibly the infamous "dot-comma-issue")
    - Time zone settings (e.g. what happens if you switch Ulaanbaatar to Perth or maybe even some US time zone?)
    - Missing hotfixes for Win and LV
    - Is the system running as virtual machine vs. "native"?
    Not so obvious differences:
    - Specific CPU type
    - Motherboard/BIOS
    - LV ini settings
    There are tons of other possible reasons (e.g. corrupt LV installation), but these are the ones i came up with within a couple of minutes....
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to get system date and time?

    Can someone show me a code on how to get system date and time.
    Thanks!

    there is one really easy way to get system time, the api gives a great example of code on this. use gregorian calendar, which you'll find in the api under GregorianCalendar. You only need to create one instance of GC, ie Calendar time = new GregorianCalendar();
    you save seconds, minute and hours into int values, so you don't have to access the system time every second, you can create a thread which adds one to the int second value, if oyu see what i mean, for example, i have saved the hours, minutes and seconds as int values;
    int hour, minute, second;
    i can then create a thread (Thread thread = new Thread(this) and run it like:
    Calendar time;
    int hour, minute, second;
    Thread thread = null;
    public MyTime() {
    hour= time.get(Calendar.HOUR_OF_DAY);
    minute = time.get(Calendar.MINUTE);
    second = time.get(Calendar.SECOND);
    if(thread == null) {
    thread = new Thread(this);
    thread.start();
    public void run() {
    Thread t = Thread.currentThread();
    while(thread == t) {
    thread.sleep(1000);
    second++;
    if(second > 59)
    minute++;
    if(minute>59)
    hour++;
    formatTime();
    public void formatTime() {
    second = (second > 59? 0 : second);
    minute = (minute > 59? 0 : minute);
    hour = (hour > 23? 0 : hour);
    System.out.println(hour+":"+minute+":"+second);
    public static void main(String[] args) {
    new MyTime();
    I know this looks like gibberish but it should work. If not, try to fix the problem, i have written from memory really but i guarantee you, this gets the time then every second, simply adds one to the second and then formats time. You can also access the day, month and year then format them using the above code. I don't like giving code since you should really do these things yourself but it is 2:04am, i have nothing better to do and i am not tired so i did you a favour - i have become what i always did not want to, someone ho stays upall night writing code.

  • I need to get the Current System Date and time in the format

    I need to get the Current System Date and time in the format
    *6/24/2009 11:30:29 AM*
    How do i do it ?

    I seem to be saying this a lot lately.
    Google is your friend.
    I googled "java current date format" and SimpleDateFormat featured prominently in the results.

  • In the numbers app, using the "date and time" function, is it possible to remove the time? I need to put together a list of dates, but I don't need or want times.

    In the numbers app, using the "date and time" function, is it possible to remove the time? I need to put together a list of dates, but I don't need or want times.

    When formatting your column to date/time, pick Date & time, and then pick the letter i in the circle to the right. Then scroll down and pick "No time"
    Jason

  • Date selection will not print properly when using Microsoft Date and Time Picker Control 6.0 in Excel 2010

    I have created a field input worksheet in which the user identifies start and end dates for training sessions, using the Date and Time Picker Active X Control.  It works fine on-screen, but when the worksheets are printed, the dates that were selected
    using the date picker calendar print out in an unreadable, huge font.  The large font also appears in the print preview mode.  I've tried modifying various properties in design mode, but nothing that I have tried will correct the problem. 
    Any ideas?

    The DTPicker seems to have some bugs in it when used on a worksheet. I have overcome the above by setting the size properties to the same size as a cell and the Linked cell property to the
    cell under the DTPicker. (Even setting the Linked cell had problems with an error message referring to the Check box property to be set to true so I just set it to true and inserted the linked cell and set the checkbox property back to
    false.)
    Then the VBA code below that Hides the DTPicker after a date is selected and unhides the DTPicker when the linked cell with the date is selected. The code is for 2 DTPickers so you will need to edit to suit your requirements.
    Caveat: If the DTPicker is visible then you can't hide it by selecting the same date again. If this occurs then it is a multi step operation. First select another date and the DTPicker will hide, then click on another cell then back on the cell with
    the date to unhide the DTPicker and then select the correct date.
    Hope it helps and feel free to get back to me with any questions etc.
    Private Sub DTPicker1_Change()
        Me.DTPicker1.Visible = False
    End Sub
    Private Sub DTPicker2_Change()
        Me.DTPicker2.Visible = False
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Select Case Target.Address
            Case "$E$5"     'This is the linked cell for DTPicker1
                Me.DTPicker1.Visible = True
            Case "$E$13"    'This is the linked cell for DTPicker2
                Me.DTPicker2.Visible = True
        End Select
    End Sub
    Regards, OssieMac

  • Display current system date and time in a form

    Hello experts from around the world,
    I have this little minor challenge that i am having difficulty cornering.
    I have a form and i want to display the current system date and time so that when i save the form its saves it with the date displayed.
    I have tried sysdate, &sysdate and &sysdate. in the default part with static text with sessions state submissions.
    So any help or suggestions would be of great help :)
    Thanks

    hi kevin
    write the below script in HTML header.
    <script type="text/javascript">
    <!--
    var d = new Date();
    var curr_hour = d.getHours();
    var curr_min = d.getMinutes();
    document.write(curr_hour + " : " + curr_min);
    </script>
    it will give the time u can assign this variable to text box item variable.
    or else check the below java script link
    http://www.mcfedries.com/JavaScript/datetime.asp
    cheers,
    Shan

  • Query: System date and time.

    hi all,
    Does any one know how to get the System Date and System Time using query. This is for my Formatted search.
    Thanks In advance.
    Bruce.

    if you are using SQL Server
    SELECT GetDate()

  • How to set the system date and time in LabVIEW 6i?

    Hi,
    How can I set the time of the computer from Labview 6i? Is there any function to do this?
    Thanks.

    Arnau wrote in message news:<[email protected]>...
    > Hi,
    >
    > How can I set the time of the computer from Labview 6i? Is there any
    > function to do this?
    >
    > Thanks.
    Not natively that I know of. You could use a LabVIEW DLL call to link
    to a Win32 API call which sets the date and time. You would need to
    have privileges to do it.
    Doug D.
    [email protected]

  • Automatic changing of activity start date and time of planned orders in SAP

    Hello experts,
    I have a requirement that in the transaction /SAPAPO/SEQ1 for the list of planned orders what ever we get in the sap we have to swap the activity start date and time for two planned orders which we select automatically. For this I have found the BADI "/SAPAPO/SEQ_VISUAL01".
    Now i am able to identify the two selected planned orders inside the BADI method SEQGRID_TOOLBAR_OKCODE_HANDLE.
    Now my requirement is i have to swap the start date and time for these two planned orders automatically i.e. through BAPI or any FM.
    Any idea of any BAPI or FM to change the details of the planned order.
    Thanks,
    Sanath.

    Hi Sanath,
    Please check this BAPI BAPI_MOSRVAPS_SAVEMULTI3.  This Bapi has the provision of chaning Planned Order & Production Order Data. Also, you can explore more info on available bapis in the T-code 'BAPI'.
    Thank you,
    Santosh KB.

  • Concat of System date and Time

    Hi,
    For concatenating the SY-DATUM and SY-UZEIT we have to use the current date function from SAP XI. But, if w euse concat function then it will want two arguments to be sent??
    Regards,
    Aniruddha

    HI ANirudha,
    Can you please explain what is your input and what output is expected .IF you want date and time at any output field then it can be achieved with Standard date fuction CURRENTDATE .it does not expect any argument you ave to use it twice in one set property as date and in secoond function set propert as time then with the help of concat function you can get the desired output .
    Regards,
    Saurabh

Maybe you are looking for

  • Web Start doesn't leave the gate on Linux and Mac

    I am evaluating Java Web Start to decide whether to recommend it as part of a government grant proposal. My initial impression of Web Start has been a sorry one. When I go to http://java.sun.com/products/javawebstart/demos.html and click on one of th

  • Connect ipad 2 to projector?

    I bought the Scosche video cables for my ipad to connect it to a projector at school. However, the projector will not recognize the ipad. Am I supposed to download a certain app? I was told to download a VGA app by a coworker but I am not using VGA c

  • Maximum Hard Drive for Macbook

    I have 160 GB hard drive. I wonder if I can upgrade the current hard drive with a new 320 GB hard drive, since Apple says '...... hard drive up to 250 GB". Any compatibility issue? TQ

  • The obligatory parameter had no value assigned to it

    Hi, Abap OO question: method is defined in the protected section, like this: METHODS: path_build IMPORTING value(i_bukrs) TYPE bkpf-bukrs                                   value(i_datatype) type char25                                   value(i_dirtyp

  • Route add command

    Hi! I have a machine with many network interfaces. I would like to add a command to say that for a destitanations tha packets shoudl be sent on port hme0 and that the source IP should be x.x.x.x I now the following command but how can I specific the