Something about getting the current Date!

I am using this code to get the current DATE ...
time=time + new Date().toString();
the out put i get looks like.......
Wed july 18 18:37:37 EDT 2001
But i want to include the time in it ,meaning i want the out to look like.......
Wed, July 18,2001
i have no clue what to do next in order to get the desired out put.
could some body please help me!

java.text.SimpleDateFormat and others are made for you :) enjoy .....

Similar Messages

  • How to get the current Date

    With the following piece of code, I am able to get the current date in bpe forms, but not when I put it in any of the forms logged in using end user(not even in end user menu).
    <Field name='request.submitDate'>
    <Display class='Label'>
    <Property name='value'>
    <invoke name='dateToString' class='com.waveset.util.Util'>
    <ref>java.util.Date</ref>
    </invoke>
    </Property>
    </Display>
    </Field>
    The following error is getting displayed in the end user menu form.
    XPRESS exception:
    Can't call method dateToString on class com.waveset.util.Util ==> java.lang.NullPointerException: -------can anyone please help me out
    or can anyone suggest a way for getting the current date
    Regards
    Gajendra Nagapurkar

    The <ref> tag is used to refer to the value of some variable. The value of the variable java.util.Date in your example is NULL, because it doesn't exist!
    If you remove that argument from your <invoke>, the call resolves to the method com.waveset.util.Util.dateToString() and will return something like "20050810 11:00:21".

  • How to get the "current date" in the BEx?

    Hi all,
    I need to get the "current date" in my Bex report in order to make a comparison. I know there is a "How to" which shows how to get the current date via a User Exit, but I didn't find it. Could you please help me?
    Thanks

    1. Create a  New Formula in Key Figures structure
    2. Give tech name and description and Select "New variable" option
    3. Next screen will launch Variable Wizard -> create a new variable with replacement path as processing type
    4. in next screene  select the date characteristic that represents the first date to use in the calculation (From Date)
    5. In the next  screen select Key in the Replace Variable with field. Leave all the other options as they are
    6. In the next Currencies and Units screen select Date as the Dimension ID.
    6. Save variable
    repeate the Above steps to create another variable (To Date)
    and now you can use these two new replacement path variables in your new formula.
    Dev

  • How to get the current date in a workflow

    Hey,
    Can anyone tell me how to get the current date while in a workflow?
    Thanks in advance.

    Here is how we did it, hope it helps
    <defvar name='locCalendar'>
    <new class='java.util.GregorianCalendar'/>
    </defvar>
    <defvar name='dateFormat'>
    <new class='java.text.SimpleDateFormat'>
              <s>MM/dd/yyyy</s>
         </new>
    </defvar>
    <defvar name='formatedDate'>
         <invoke name='getTime'>
    <ref>locCalendar</ref>
    </invoke>
    </defvar>
    <invoke name='format'>
    <ref>dateFormat</ref>
    <ref>formatedDate</ref>
    </invoke>

  • How to get the current date ? in the form of dd/mm/yyyy?

    Hi all,
    As getDate( ), getMonth( ), and getYear( ) is depricated, how to get the current date or System date, month and year ? please help ??
    Regards
    Ashvini

    HI,
    Than u for the reply. But i am getting one error.
    as u said, I tried to do so.........
    but, i am getting one error.
    code
    Calendar cald=(Calendar.getInstance.getTime());
    out.println(cald);
    error message
    validate$jsp.java:86: Attempt to reference method getInstance in class java.util.Calendar as an instance variable.
    Calendar cald=(Calendar.getInstance.getTime());
    ^
    1 error
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    Pls help
    Regards,
    Ashvini

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • Get the current date

    How does one get the current date?

    I would not use the date object (mostly deprecated), instead use the Calendar object.
    See...
    http://java.sun.com/j2se/1.3/docs/api/index.html

  • Variant must get the current date from the system.

    Hi All,
    I really appreciate your help on below please;
    I need to create a variant and schedule a report program once a day.
    But variant must get the current date from the system (sy-datum).
    The program should run for the values in the variant in schedule job run;
    Can I do this using SAP variants (for Report Program) and schedule the job.
    Many thanks
    Iver

    Standard functionality.
    http://help.sap.com/saphelp_nw70/helpdata/en/c0/98039be58611d194cc00a0c94260a5/frameset.htm
    Thomas

  • GregorianCalendar - getting the current date

    Hi,
    Have any of the Calendar classes been changed in version 1.5. I'm trying to get the current date and time in an application, to add to filenames when they are backed up. In java 1.4 the following code was sufficient to get the information required:
    GregorianCalendar cal = new GregorianCalendar();
    filename = "C:\\Program Files\\Apache Group\\Apache2\\www\\test\\htdocs\\backups\\";
    filename += theFile;
    filename += "=" + getUser() + "=" + cal.get( Calendar.HOUR_OF_DAY ) + "_" +
         cal.get( Calendar.MINUTE ) + "=" + cal.get( Calendar.DAY_OF_MONTH ) + "_" +
         ( cal.get( Calendar.MONTH ) + 1 ) + "_" + cal.get( Calendar.YEAR );
    I'm writing another app using the same code and SDK 1.5, but it's returning the same values every time.
    Cheers
    Matt

    I wrote a small program to test the Calendar object on my system:
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Tester extends Frame implements ActionListener
         public Tester()
              javax.swing.Timer timer = new javax.swing.Timer( 1000, this );
              timer.start();
              setSize( 400, 400 );
              show();
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing( WindowEvent e )
                             System.exit( 0 );
         public void actionPerformed( ActionEvent e )
              Calendar cal = new GregorianCalendar();
              System.out.println( "Time: " + cal.HOUR + ":" + cal.MINUTE + ":" + cal.SECOND );
         public static void main( String args[] )
              Tester t = new Tester();
    This repeatedly outputs:
    10:12:13
    I tried this with Calendar and GregorianCalendar. Both of them do not seem to work. I'm not using the same Calendar object, or outputing in the same second....

  • Get the Current Date and Time of a Location

    I have created a windowsPhoneApplication in silverLight 8.1.In my application,I have to upload videos on some server.The Uploading get failed If the Date and Time settings of my device is not the current Date and Time.So How can I get the current date
    and time even if the device settings is wrong?

    Hi shifana,
    Do you know server's time zone? If yes, you can manually translate to the correct time zone.
    Otherwise try some online time acquire API.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Get the Current data into Planning Layout from the Planning cube

    Hi,
    I have a problem in BPS.   I am selecting the data from cube based on Month org details but I want to see the latest data.   How can i get this data into planning cube.
    Like
    data
    Tran           cal month            org               amt
    1                 jan                        a                  100
    1                 feb                        a                   200
    if i want to read based on Tran org as input values I shoud get the below data but I am getting the previous data.   
    Tran           cal month            org               amt
    1                 feb                        a                   200
    Kindly help me in this regard
    Thanks
    Naveen

    Naveen,
        Are yo having issue when you save something in the layout, the data doesn't appear in the listcube ? Or do you have issue that the latest data you see in the cube doesn't appear in the layout ?
    For the former issue, please look at your selections of listcube and for the second issue, please check your planning level definition, make sure all the restrictions you have applied are valid for this latest data to be presented in the layout.
    Hope this helps.
    Cheers
    Srini

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to get the current date in standby display?

    My N73 ( 3.0705.1.0.31 ) displays the current date/day only in the general profile. When I switch to any other profile, that place is taken over by the profile name.
    Is it possible to get the date/day displayed in a non general profile?
    If it is otherwise, the 240x320 display is of little use...
    V 4.0727.2.2.1
    04-07-2007, RM-133
    (C) Nokia N73 (Z5.01)

    That's the way it goes. In addition you see the date/time on the screensaver with every/any profile.

  • How to get the current Date from the system?

    How do I acquire the current date from the system? Also, if possible, can I assign the day, month and year separately into three variables and how? It would be thankful if some simple Example could be given. Thanx!

    import java.util.*;
    public class count {
    public count() {
    Calendar now = Calendar.getInstance();
    int month = now.get(Calendar.MONTH);
    int day = now.get(Calendar.DAY_OF_MONTH);
    int dayyear = now.get(Calendar.DAY_OF_YEAR);
    int year = now.get(Calendar.YEAR);
    int a = 365;
    int b = a - dayyear;
    System.out.println("The day is the" + " " + day);
    System.out.println("IT is the" + " " + month + " " + "month of the year");
    System.out.println("The year is" + " " + year);
    System.out.println("This many days till next year" + " " + b);
    public static void main(String[] args) {
    count cou = new count();
    }

  • How to get the current date using HTMLB JSP page

    Hi All, I developed an iview with several fields using PDK, I would like to know how can I include for a date field a dynamic value witch in this case is the current date.
    <hbj:inputField
    id="Date"
    type="date"
    maxlength="10"
    showHelp="TRUE"
    required="TRUE"
    value="???"
    />
    Thanks in advance
    Alexis

    Hi Alexis ,
    u can use the setDate("3.12.2003") function to set date for this input field.
    u just change the id = Date , because in jave we have Date class. rename it to another name..
    suppose id = systemDate
    <%
    Format formater = new SimpleDateFormat("dd.MM.yyyy");
    Date syDatum = new Date();
    %>
    then
    put
        systemDate.setDate(formater.format(syDatum));
    this will set the date .....
                        Regards
                        Kishor Gopinathan

Maybe you are looking for

  • How do i use my own dhcp server with airport extreme

    I just bought an airport extreme and I'm trying to replace my linksys router and another access point. I have my own dhcp/dns server and I want to continue using it. So far, I was not able to find the way to use NAT without DHCP (like I'm doing now w

  • Is there a way to block invitation notifications?

    My company uses Google calendar. I have a personal calendar, and then everyone has access to the companywide calendar as well. This allows us to see every meeting happening in the company. When we create new events, we create them in the companywide

  • What is wrong with my iMac?

    I have bought a 2012 imac had nothing but problems since I bought it. It crashes on Sims and now today opened mail and chrome and it froze the whole computer couldnt even force quit. So fed up with it!!!!! 3.1GHz intel core i7 16 GB 1600 MHz DDR3 NvI

  • More than 6 Calendars in Monthly View?

    Is there any way to show more than 6 Calendars in the Monthly View? After 6 are displayed, there are just 3 dots that indicate that there are more Calendars out of sight. Thanks, Chris. Message was edited by: o'crikey

  • Program logic for IDoc

    hi everyone, I am new to IDoc. Through some forums i came to know that we need to create segment in we30 idoctype in we31 i understand the above two msgtype in we80 attaching msgtype to idoctype in we81 i didnt understand how to do the above two, and