How to get current time and set to yyyy/mm/dd hh:ss

Dear friend:
how can i get computer current date and time and set to yyyy/mm/dd hh:ss
like this "2011/03/02 16:40:23" ? i want to pass this date to my sql server for quering.
thank for helping

see this:
http://livedocs.adobe.com/flex/3_cn/langref/mx/formatters/DateFormatter.html

Similar Messages

  • How to get current time and date??

    How to get current time and date from my PC time and date to the java application??
    i use java.util.* package but got error, that is:
    - java.util.* and java.sql.* class are match
    - abstract class cannot be instantiated
    so what can i do, pls guide...thanks...

    There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
    Don't import *. Import the specific classes you need.
    Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother.

  • How to get current month and last month dynamically??

    how to get current month and last month dynamically
    like
    month = getCurrentMonth();
    lastmonth = getcurrentMonth() -1;
    please help
    thanks

    hi :-)
    /* depracated but can be still useful */
    java.util.Date dtCurrent = new java.util.Date();
    int month = dtCurrent.getMonth();
    int lastmonth = dtCurrent.getMonth() - 1;
    System.out.println("* " + month);
    System.out.println("* " + lastmonth);
    /* better to use this one */
    Calendar cal = new GregorianCalendar();     
    int imonth = cal.get(Calendar.MONTH);
    int ilastmonth = cal.get(Calendar.MONTH) - 1;
    System.out.println("*** " + imonth);
    System.out.println("*** " + ilastmonth);
    regards,

  • How to get System Time and Date?

    Hi, may i know how do i get the System's current Time and Date?? And i need to format them into 2 separate String, that's Time is a String, Date is another String. Pls guide me. Thanks a lot!

    What's the problem? The previous example was pretty clear. Just adapt it to your purposes...
            Date currentDateAndTime = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
            SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
            System.out.println(dateFormat.format(currentDateAndTime));
            System.out.println(timeFormat.format(currentDateAndTime));

  • Anyone know how to get current time using Java?

    Hi,
    do anyone know how to use system.currentTimeMillis() to get the current time?
    I know that system.currentTimeMillis() get the time between current time and midnight, January 1, 1970 UTC. but how to use it to get the current time format?
    Thank you very much.

    Hi,
    do anyone know how to use system.currentTimeMillis()
    to get the current time?
    I know that system.currentTimeMillis() get the time
    between current time and midnight, January 1, 1970
    UTC. but how to use it to get the current time format?
    Thank you very much.
    long timeInMillis = System.currentTimeMillis();
    Calendar c = Calendar.getInstance();
    c.setTime(timeInMillis);
    Date d = c.getTime();And format using SimpleDateFormat:
    SimpleDateFormat sdf = new SimpleDateFormat("dd-mm-yyyy HH:mm:ss");
    String formattedDateString = sdf.format(d);

  • How to generate current time in the format yyyy-mm-ddThh:mm:ssZ in the xslt

    Hello,
    i am tring to generate current time in the format yyyy-mm-ddThh:mm:ssZ in my xlst file.
    the following info are necessary,
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
    version="1.0">
    <xsl:attribute name="generationDate"><xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy-mm-dd hh:mm:ss'), java:java.util.Date.new())"/></xsl:attribute>
    but java SimpleDateFormat doesnt support yyyy-mm-ddThh:mm:ssZ.
    thanks in advance.

    Hi wwuest,
    I use the following code to generate such a date format :
              try {
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   Date date = sdf.parse(strDate);
                   sdf.applyPattern("yyyy-MM-dd'T'hh:mm:ss");
                   strDate = sdf.format(date);
              } // catching the parse exceptionMaybe you could try this method and see if it pass through xsl with :
    new SimpleDateFormat("yyyy-MM-dd").applyPattern("yyyy-MM-dd'T'hh:mm:ss'Z'")Bye

  • How to get current time in TimesTen

    I need to get the current timestamp of TimesTen DB located node, how can get it?
    In PSQL, I can use built-in function now(), In Oracle, I can use LOCALTIMESTAMP, thanks. a lot.

    Hi Vikas,
    Firstly, the syntax you give
    select to_char(sysdate,'dd-mm-yyyy hh24:mi:ss.FF') as ts from dual;
    does not work in Oracle DB - it gives an eror due to the '.FF' in the format string.
    This syntax does work just fine in TimesTen (which is a little more tolerant).
    However, this is not a very useful thing since the resolution of SYSDATE is 1 second and to accurately measure data fetch times you need accurate microsecond resolution. Also, you would need to take an average over many millions of measurements to get any degree of accuracy.
    Realistically, this will be a very difficult thing to measure with any accuracy. Might I understand what you are exactly looking to achieve here? For the same amount of data, separateing 'fetch' from SQL execution, TimesTen in direct mode will return data much, much faster than an Oracle client/server connection wven when the client is on the same machine as oracle. For Tt client/server mode the data transfer performance will be very similar to that for Oracle.
    Chris

  • How to get current time

    Hi,
    I would like to know how to get the current time (07H25 for instance).
    Does someone know how to do it ?
    Thanks in advance, Fred.

    java.util.Date = new java.util.Date();
    The above code produces an object which contains a timestamp (date and time) for the instance in which it was created.
    To display it in any format you wish you would use the java.text.SimpleDateFormat class.

  • How to get current time in seconds

    Can someone please tell me how to get the current time in seconds. I am currently doing as follows but not sure if its correct or best way:
    Calendar cal = new GregorianCalendar();
    long currentTimeInSeconds = cal.getTimeInMillis()/1000;

    vik1491 wrote:
    How about this:
    Date date = new Date();
    Format formatter = new SimpleDateFormat("HH:mm:ss");
    String s = formatter.format(date);
    String patternStr = "\\:";
    String[] fields = s.split(patternStr);
    int secondsSinceMidnight= Integer.parseInt(fields[0]) * 3600 + Integer.parseInt(fields[1]) * 60 + Integer.parseInt(fields[2]);
    What about the day what you switch between standard time and daylight savings time?

  • How to get Current day and month value in Stk applets

    Friends please provide me the hint to get the Current Value of month and date from the Mobile equipment(ME).
    please send feedback to [email protected]

    Use "PROVIDE LOCAL INFORMATION" command as per GSM 11.14. This however queries the handset date and time, and hence depends on the handset clock (which may not always be reliable).

  • How to get current time in jsp page?

    my problem is :-
    i have a radio buttons with name as 9am, 11am ,1pm, 3pm , 5pm , 7pm , 9pm , 11pm , 1am , 3am ,5am 7am. what ever the current time may be the radio button of four hour plus than current time should be atomatically checked and previous radio buttons should be disabled. for example suppose current time is 11.02am than the radio button of 3pm should be automatically checked and previous radio buttons should be disabled.
    please help me if u can?

    This should work but it needs testing out around midnight ( not sure if it is 00:00 or 24:00):
    <%@ page import="java.util.*" %>
    <html>
    <head><title>Time Page</title>
    </head>
    <body>
    <% Calendar c = Calendar.getInstance();
       c.add(Calendar.HOUR_OF_DAY, 4);
       int h = c.get(Calendar.HOUR_OF_DAY); %>
    The current hour is <%= h %><br>
    <% for (int i=0; i < 24; i++) { %>
       <input type=radio name=time <%= (i < h) ? "disabled" : ""%><%= (i == h) ? "checked" : ""%>><%= (i < 10) ? "0" : ""%><%= i %>:00<br>
    <% } %>
    </body>
    </html>

  • How To Include Current Time and Date in Form

    Does anyone know how I can include the time and date in the
    body of a form mailer? Our system allows the receiver of each
    submitted form to copy the body of the form entries and paste them
    into either Excel or FileMaker for database building. They would
    like to have the time and date also appear somewhere in the
    submitted body so they will not have to do a seperate copy/paste of
    the time and date seen in the header... I followed the javascript I
    found in the Adobe website and included it within the form, but
    when I ran a test nothing showed! Here is the form...
    Click
    Here to see the Form
    Thanks for your help! -D

    Can you not use when the email's timestamp?
    Also, in z7's script, beware the common mistakes, if you try
    to retype it - .getDate() gives the day of the month (1-31), but
    .getDay() gets the day of the week (1-7). To make it more
    confusing, .getMonth() gets the month (0-11), so you have to add
    one to make it human-readable. The script posted is correct, but I
    went round and round with my PC when I tried to do that the first
    time!

  • How to get system time and date with PHP

    Dear Mr.Craig,
      Thanx a lot. We are running SRM 5.0 (RAMP - Implementation).
      My initial requirement is to write a server-side script to display server date and time. Could you give more inside on how to achieve it?
    Regards,
    Deva.

    Perhaps that will help.
    [code]
    <html>
    <h1>Access System time and date</h1>
    <?
         // saprfc-class-library     
         require_once("saprfc.php");
         $sap = new saprfc(array(
       "logindata"=>array(
       "ASHOST"=>"localhost"          // application server
       ,"SYSNR"=>"00"                    // system number
          ,"CLIENT"=>"000"               // client
          ,"USER"=>"bcuser"               // user
          ,"PASSWD"=>"minisap"          // password
         ,"show_errors"=>false               // let class printout errors
         ,"debug"=>false)) ;                     // detailed debugging information
         $result=$sap->callFunction("MSS_GET_SY_DATE_TIME",
            array(     array("EXPORT","SAPTIME",array()),
               array("EXPORT","SAPDATE",array())));
         if ($sap->getStatus() == SAPRFC_OK) {
        echo "Time: ".$result["SAPTIME"];
        echo "<br>Date: ".$result["SAPDATE"];
        echo "<br>or<br>";
        echo "Server is showing: "
             .substr($result["SAPDATE"], 0, 4)
             ."-".substr($result["SAPDATE"], 4, 2)
             ."-".substr($result["SAPDATE"], 6, 2)
             ." and "
             .substr($result["SAPTIME"], 0, 2)
             .":".substr($result["SAPTIME"], 2, 2)
             .":".substr($result["SAPTIME"], 4, 2);
         } else {
              $sap->printStatus();
         $sap->logoff();
    ?>
    [/code]

  • How to get charEncoding property and set it to a perticular encoding?

    hi all,
    i would like to know
    1)how to get browser encoding property
    2) if the encoding is Western European(ISO) how can we change to arabic
    windows.
    i think i have to use like below
    request.getCharacterEncoding();
    request.setCharacterEncoding();
    but i dont have any idea what is charencoding for Western European(ISO) and arabic windows.
    Am i in the right direction.
    waiting for a valid solution.

    those are the methods, but you can't use getCharacterEncoding(), actually, cuz it seems it's not necessarily filled in.. or at least that might be on some servers only, like Tomcat 4. As for encodings, you need to do a search for character encoding names and use the appropriate one.

  • How to get Current week and No of Weeks for each quarter!!

    Hi,
    As a part of report development I have to derive Current week and No.of Weeks in Curreny Query. Based on these information I have to calculate Phased target (Calculated KYF).
    Phased target = (Target for Quarter / No of weeks in Current Quarter) X Current Week.
    We have to derive Current Quarter and Current week from  Customer Exit (From Invoice date, which is an entry by Users at report level).
    My questions are:
    1) We have to derive Two Restricted key figures (by Calweek)  for derving No of weeks for Currnet Quarter and Current week in Query level. Based on this info, we have to derive Calculated kef figure for Phased target.
    2) And the output is 6 (ex:- 132008) char length for Current week and we have to pick Week info only and we have to populate RKF created for Current week. How we can achieve this.
    3) Regarding the No of weeks per for current quarter, we are writing Customer exit to determine Quarter and no of weeks, but how to bring this info in query level.
    4) Is there any standard code available (SAP Exit) to find Current week and No of Weeks in Current quarter.
    Regards,
    Suresh Molli

    Hi Venkat Molli,
    Follow the below step for the doing the same:
    1. Create a customer exit variable on calweek.
    2. Restrict the created variable for respective info object.
    3. To Populate the data write code in CMOD.
         in enhancement function module: EXIT_SAPLRRS0_001 -> in Include ZXRSRU01 write the below code:
    WHEN '<variable name>'.
         IF i_step = 1.
          CLEAR l_s_range.
          CALL FUNCTION 'RSVAREXIT_0P_CWEEK'
            IMPORTING
              e_t_range = lt_week.
          READ TABLE lt_week INTO l_s_range1 INDEX 1.
          v_last_week = l_s_range1-low+4(2).
          v_last_week =  v_last_week - 1.
          l_s_range1-low+4(2) = v_last_week.
          l_s_range-low      =  l_s_range1-low.
          l_s_range-sign     = 'I'.
          l_s_range-opt      = 'EQ'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    4. Execute the report.
    I hope you can handle you issue now.
    Assign points if it is helpful.
    Regards,
    S P.

Maybe you are looking for

  • Removing Tree Nodes

    Hi I have created a tree using the DefaultMutableTreeNode class, and I'm displaying it in a ScrollPane. When I add a new node to an existing node, everything works ok. But when I go to remove that node afterwards, nothing happens. The node is still t

  • Future feat for Muse with PHP Wordpress

    Wordpress requires PHP and Muse currently doesn't support that programming language. this could be something to look forward in the future? I absolutly love Muse and I would like to start doing Wordpress theme with. will it be possible some day?

  • Split dates into different shifts.

    Hello all, I'm trying to setup a query to get my date ranges into 8 hour shifts which start at 23:00, 07:00, and 15:00. create table t (start_date, end_date) insert into t values (to_date('11-21-12 21:02:15', 'MM-dd-yy HH24:MI:ss'), to_date('11-21-12

  • Debug Procedure using JDev10g

    I was using Oracle JDeveloper 10g to debug a pl/sql procedure. I used to do it on different Oracle server and debug works fine. This time, after I let DBA granted the DEBUG connect session and DEBUG any procedure priviledges, I got new problem. I did

  • Parameters in XMLQuery

    Sorry to repost this question but haven't had any reply to the previous post. The question: is how to pass the "EMAIL" in the query below as parameter (instead of hardcoding it). SQL> select acc_no, XMLQuery( 'for $i in /CommRecord where $i/CommType