Output Date with the our

I want to add Date with time in my code. how can I do that
Thanks

Hi,
The code snippet for getting the current time and displaying in Format: yyyy-MM-dd HH:mm:ss
import java.util.Calendar;
import java.text.SimpleDateFormat;
public class DateUtils {
public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
public static String now() {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return sdf.format(cal.getTime());
public static void main(String arg[]) {
System.out.println("Now : " + DateUtils.now());
Hope this helps you!
Regards,Srilatha M

Similar Messages

  • How to display data with the same text and key in the drop down list?

    Hi All,
    Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    REPORT ZTESTING.
    TYPE-POOLS: VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST,
          c(20) type c.
    *      c = 'select any'.
    data:begin of itab occurs 0,
          kunnr like kna1-kunnr,
          name1 like kna1-name1,
         end of itab.
    data:begin of jtab occurs 0,
          kunnr like kna1-kunnr,
          land1 like kna1-land1,
         end of jtab.
    PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
                              default 'SELECT'.
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'p_list'.
    VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    APPEND VALUE TO LIST.
    VALUE-KEY = '2'.
    VALUE-TEXT = 'Country'.
    APPEND VALUE TO LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    start-of-selection.
    select kunnr name1 up to 20 rows from kna1 into table itab.
    select kunnr land1 up to 20 rows from kna1 into table jtab.
    case p_list.
    when '1'.
    loop at itab.
    write:/ itab-kunnr,itab-name1.
    endloop.
    when '2'.
    loop at jtab.
    write:/ jtab-kunnr,jtab-land1.
    endloop.
    endcase.
    <Added code tags>
    Moderator Message: Please use the "code" tags to format your code snippet.
    Edited by: Suhas Saha on Nov 17, 2011 11:19 AM

    shawnTan wrote:
    Hi All,
    >
    > Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
    >
    >
    REPORT ZTESTING.
    >
    > TYPE-POOLS: VRM.
    >
    > DATA: NAME  TYPE VRM_ID,
    >       LIST  TYPE VRM_VALUES,
    >       VALUE LIKE LINE OF LIST,
    >       c(20) type c.
    >
    > *      c = 'select any'.
    >
    > data:begin of itab occurs 0,
    >       kunnr like kna1-kunnr,
    >       name1 like kna1-name1,
    >      end of itab.
    >
    > data:begin of jtab occurs 0,
    >       kunnr like kna1-kunnr,
    >       land1 like kna1-land1,
    >      end of jtab.
    >
    > PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
    >                           default 'SELECT'.
    >
    > AT SELECTION-SCREEN OUTPUT.
    >
    > NAME = 'p_list'.
    >
    > VALUE-KEY = 'Name'.     "---> Data for key is the same with text
    > VALUE-TEXT = 'Name'.    "--> Data for text is the same with key
    > APPEND VALUE TO LIST.
    >
    > VALUE-KEY = '2'.
    > VALUE-TEXT = 'Country'.
    > APPEND VALUE TO LIST.
    >
    > CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    >
    > start-of-selection.
    > select kunnr name1 up to 20 rows from kna1 into table itab.
    > select kunnr land1 up to 20 rows from kna1 into table jtab.
    >
    > case p_list.
    > when '1'.
    > loop at itab.
    > write:/ itab-kunnr,itab-name1.
    > endloop.
    >
    > when '2'.
    > loop at jtab.
    > write:/ jtab-kunnr,jtab-land1.
    > endloop.
    > endcase.
    >
    > <Added code tags>
    >
    > Moderator Message: Please use the "code" tags to format your code snippet.
    >
    > Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
    This surely seems to be a bug to me(if not by design),  did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
    -Rajesh.

  • HT201359 Why the ISTORE of Malta is not up to date with the latest movies and series like the UK & USA and why old movies are being uploaded .

    Why the ISTORE of Malta is not up to date with the latest movies and series like the UK &amp; USA and why old movies are being uploaded .
    I believe the apple should be universal in all the products and a small island like Malts should have the same products for sale on ISTORE like of the UK and USA.

    The iTunes and App stores are inherently different in different countries.  Local laws on copyright and other limits on the distribution of intellectual property make it impossible for Apple to simply put everything in every store.  Sometimes, the owner of the intellectual property does not allow it to be distributed everywhere.  Keep in mind that Apple does not own the music, books, movies and such that they allow for sale in their store front, so they do not necessarily have any say in what may, or may not appear in what store.

  • If i associate my apple id with another email will i lose my icloud data or i will still be able to access all my stored data with the new linked to my apple id email address?

    hi there
    if i associate my apple id with another email will i lose my icloud data or i will still be able to access all my stored data with the new linked to my apple id email address?
    i mean i am not signing up for a new account, just changing my old id primary email which is my apple id login into account.
    in other words, www.icloud.com will recognize that it is still me if i login on the site? will i be able to see there all my stored information?
    and if i change my password, does it automatically changes the @icloud.com password which should be the same as my apple id pass?
    thanks

    After opening the email it shoud of had you enter the Apple ID and password. Using certian web browser's can cause errors. You can adjust securty settings (big pain) or you use another browser. Using Firefox or Safari should do the trick.
    Let me know if using Firefox or Safari resolved it.

  • How to get the exact day date with the another date field?

    Hi,
    Please help me how to get the specific day of the week's date with the help of another date field.
    Actually , one field(week_day) has 1,2,3,4,5,6,7 here 1--MON,2-- TUE like that.
    another field has the date. based on that date, we have to go to that particular week and need to pick up the date by the above week_day. It should be in that week itself.
    Thanks in advance!!
    Regards,
    Vissu...
    Edited by: vissu on Oct 29, 2010 3:07 AM

    Hi,
    Something like this
    SELECT TRUNC(<DATE_COLUMN>,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the particular week of the date
    SELECT TRUNC(SYSDATE,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the current week
    cheers
    VT

  • Enable the extension to keep chrome bookmarks up to date with the safari bookmarks on your iphone

    on my laptop icloud comes up and tells me i need to enable the extension to keep chrome bookmarks up to date with the safari bookmarks on your iphone! if someone could help me i would be grateful !!

    Once you click "get new recovery key" all data on your sync account is erased forever. There is no way to get that back. If you have data on your iPhone you cannot move it from your iPhone to desktop Firefox. the iPhone sync is 1-way only. Unless you have a Firefox profile somewhere, you will ahve to manually rebuild your bookmarks.

  • HT4623 Why will my Iphone 4 not connect to internet on wifi nor data with the ios 6.1 update?

    Why will my iphone 4 not connect to the internet on wifi nor data with the ios 6.1 operating system?

    Settings > General > Reset > Reset Network Settings

  • How to get  data with the raw pattern from resultset ?

    would you tell me how to get data with the raw pattern from resultset ?
    thank you in advance!
    longgger2000

    I tried getBytes() and getObject()
    , but I can not get the right result , for example the
    data in oracle database is 01000000DFFF, when In used
    the method of getBytes() and getObject(), I get the
    result of [B@1c2e8a4, very different , please tell me
    why !
    thank you
    longgger2000
    [B is byte arrayseem that it return an bytes array for you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help tells me that i am up to date with the latest version BUT the firefox start link tells me i am NOT on the latest version. what is going on?

    help tells me that i am up to date with the latest version BUT the http://www.google.co.uk/firefox?client=firefox-a&rls=org.mozilla:en-GB:official link tells me i am NOT on the latest version. what is going on?.
    also:
    please can sync also copy my addons too?

    Firefox is a web browser not a homepage.
    It sounds like you you have the old www.google.com/firefox/ start page that used to be the default homepage in Firefox before Firefox 4.0 sometime. It is not being maintained by Google anymore so either ignore the message or while in Firefox go to Tools->Options->General->Homepage section and change your homepage.

  • What does "Always stay up to date with the latest photography innovations from Adobe" mean ?

    Hello,
    I'm considering buying Lightroom 6 standalone version, but I wonder what the fact that "Always stay up to date with the latest photography innovations from Adobe" isn't available means ?
    Will the standalone version be updated for free with new camera support ?
    Will the standalone version be updated for free with defects correction ?
    If there are new functionalities (lightroom minor version), won't they be available for standalone version before the next major version ?
    Thanks for your help

    My understanding is that LR6 will continue to receive bug fixes and new camera support updates, but not any new functionality/features that LRCC receives. See question 2 at the bottom on this post: Lightroom CC/Camera Raw FAQ

  • In Report output, Missing Plan data with the Seletion option - Single Value input (more than 10 values)

    Hi ,
    I am running the Query (Actual Vs Plan) in the BEx Analyzer, with the input for the characteristic like Fiscal Year, Posting Period and Cost Center(20 Single value) it not comming up with the plan data - Actual data is coming up fine.
    If i gave 10 or less than 10 inputs ( single values input in the selection - option ) for the characteristic COST CENTER it coming up with all the data (Both plan and Actual).  if the COST CENTER input values more than 10, it not coming up plan data (Actual data is coming)
    Cost Center Variable is designed with an Authorization Variable.
    Can any one please help me to know why plan data is getting miss when the input limit more than 10 (single values input in the selection - option) in the Cost Center Variable? 
    An also could you please share that, What is the Max limit for the Single values and Range Value for an Selection - option in the BEx Variable.

    A)    Hi ,
                 In Report, I am having 2 variant.
    1.   For one variant, i have saved the input values for both the Select Single values & Select range for the cost center.
    8 Values in single & 4 Values in Ranges         
    It coming up with data successfully.
    2.    Another variant having input only for select single values for the COST CENTER, it contains 20 records (This variant also have restricted with the same values as above variant for COSTCENTER variable)
    Fiscal year                         : 2012
    Posting period                   : 8
    Cost Center                        : 20 values in Single                                             (Here I have separated the range values into single)
    It’s not coming up with plan data. 
    B)   If I gave only first 10 values in the Single value, Output for both actual and Plan are coming up…………. If I gave the Second 10 value in the Single value and got the Output for both actual and Plan.
    C)    I have also checked the following details of this query, 
    Executed the query in RSECADMIN and checked the Authorization log as below,
    Relevant Characteristics for Detailed Authorization Check  (Characteristics with Full Authorization Are Not Listed!)
      List of Effective Authorization-Relevant Characteristics for InfoProvider ZPCA_M36: 
    List Is Empty:
      There Are No Characteristics That Have to Be Checked in Detail 
              2.  Checked the Single value input by iteration, 1 to 10, it retrieves data.  More than 10 like 11, 12 … is getting failed to pull plan data.
              3. checked the selection Value range by iteration and I gave the range value count up to 25        inputs, its works fine.
    Thanks.
    Regards,
    Subashini.

  • Automated process to compare new data with the existing

    Below is the requested task and I am not sure if I can do this with only Database and ETL skill.
    "New customers access out site and I get a http:// request notifying me with new people accessing our website. I need to somehow take this new customer and compare with the existing customer table  and make sure that it is not an existing one.
    If it is new , I need to send a http:// notification back to a third party saying that this is new. Also, this all has to be done REAL TIME. "
    I am not sure if I can do all these real time by just using SSIS .
    Any input is much appreciated. Stay warm Folks!

    A new customer has to register, am I right? Then issue SELECT * FROM Customers WHERE Customerid=@CustomerID IF @@ROWCOUNT=0 that means it is a new one... You can use EXEC msdb.dbo.sp_send_dbmail to send a notification ....
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • What is the effect of output signal with the same sampling frequency but different number of samples?

    Hi,
    I'm using PXI4461 for audio measurement and there is a question about analog output. I'm using the Basic Multitone vi for generating multitone signal. The sampling rate is 200k and my question is how to determine the number of samples. I used an audio analyzer to measure the distortion of the output signal with 200k and 1k points and there are no different except the update rate. What number of samples is suitable for 200k sampling rate?
    Thanks,
    Bill

    The Sampling Rate determines the maximum frequency that you can see (the rate/2 according to Nyquist).
    The number of samples divided by the rate determines how long you will sample. This sample time can only be determined by you. Do you need .1 seconds worth of data, or 1 second? But note that the MINIMUM frequency that you can detect is 1/(Sample Time) or the Sampling Rate/Number of Samples. So if your system has a minimum and maximum frequency specification use that as your guild.
    [email protected]

  • Can't view my Cube and Dimension Data with the Cube Viewer

    I'm new in using OWB, i'm using Oracle 10g release1 with OWB R2 also Oracle WorkFlow 2.6.3.
    When studying with the steps from the OTN pages (start01, flat-file02, relational-wh-03, etl-mappings, deployingobjects, loading-warehouse and bi-modeling)
    the loading was success, i guess...
    But when I want to see the data in the cube and dimension, an error occurs.
    It says
    " CubeDV_OLAPSchemaConnectionException_ENT_06952??
    CubeDV_OLAPSchemaConnectionException_ENT_06952??
         at oracle.wh.ui.owbcommon.dataviewer.dimensional.DataViewerConnection.connect(DataViewerConnection.java:115)
         at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerMain.BIBeansConnect(DimDataViewerMain.java:433)
         at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerMain.init(DimDataViewerMain.java:202)
         at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerEditor._init(DimDataViewerEditor.java:68)
         at oracle.wh.ui.editor.Editor.init(Editor.java:1115)
         at oracle.wh.ui.editor.Editor.showEditor(Editor.java:1431)
         at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorByClass(IdeUtils.java:1431)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1344)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1362)
         at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:864)
         at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:851)
         at oracle.wh.ui.console.commands.DataViewerCmd.performAction(DataViewerCmd.java:19)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) "
    Can somebody explain what is happening, I really don't understand, when the cube viewer window appears, there's no data in it....
    I realy need help with this...

    I'm new in using OWB, i'm using Oracle 10g release1 with OWB R2 also Oracle WorkFlow 2.6.3.
    When studying with the steps from the OTN pages (start01, flat-file02, relational-wh-03, etl-mappings, deployingobjects, loading-warehouse and bi-modeling)
    the loading was success, i guess...
    But when I want to see the data in the cube and dimension, an error occurs.
    It says
    " CubeDV_OLAPSchemaConnectionException_ENT_06952??
    CubeDV_OLAPSchemaConnectionException_ENT_06952??
    at oracle.wh.ui.owbcommon.dataviewer.dimensional.DataViewerConnection.connect(DataViewerConnection.java:115)
    at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerMain.BIBeansConnect(DimDataViewerMain.java:433)
    at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerMain.init(DimDataViewerMain.java:202)
    at oracle.wh.ui.owbcommon.dataviewer.dimensional.DimDataViewerEditor._init(DimDataViewerEditor.java:68)
    at oracle.wh.ui.editor.Editor.init(Editor.java:1115)
    at oracle.wh.ui.editor.Editor.showEditor(Editor.java:1431)
    at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorByClass(IdeUtils.java:1431)
    at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1344)
    at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1362)
    at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:864)
    at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:851)
    at oracle.wh.ui.console.commands.DataViewerCmd.performAction(DataViewerCmd.java:19)
    at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) "
    Can somebody explain what is happening, I really don't understand, when the cube viewer window appears, there's no data in it....
    I realy need help with this...

  • Access to BPM Task/Process CONTEXT data with the BPM Java API

    Dear all,
    is there a possible way to extract the content data from a process Instance? We want to read out all the data of the current intstances from a backend system. The API CE7.3 SP3 supports only (or we didn't find it) Instance Header data (like start-time,..)
    Regards,
      Christian

    Hi
    There's no straight way to retreive process instance context variables.
    But In my mind, there is a hack way - find appropriate tables in oracle db, where BPEM stores information about process instances and read it with jdbc.

Maybe you are looking for

  • Acrobat 9 crashes

    I have downloaded Acrobat 9.0 and installed on my harddrive. When trying to start program I get this error-message: "Runtime Error! Program C:\Programfiler\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe Abnormal program termination" I have tried to repair in

  • Error in Jboss while creating User

    Hey, I am getting below errors in Jboss when trying to create user (manually or recon) Insufficient method permissions, principal=null, ejbName=tcLookupOperations, method=create, interface=LOCALHOME, requiredRoles=[User], principalRoles=[] [DATABASE]

  • Changing Default Font in Acrobat 7 and/or Acrobat Reader 9

    Anyone know how to change the Default Font in Acrobat 7 and/or Acrobat Reader 9?  Whenever I open a PDF document the text defaults to a Times New Roman or basic font.  Can we change the default font?

  • No user group created - Adhoc Query transaction error

    Hi there, Whenever I try to access the Adhoc Query transaction S_PH0_48000513 i get the error "No user group created". The required user groups are present in the system. Any idea why am I getting this error? Regards, Anjali.

  • Assginment of services to service type

    When creating an order with service type ABCDE as item, item not automatically appearing on order. The service type should automatically map to item as other pm service types work. For vehicle some service is due on 1st Nov 2009 and the service which