How to change the date format  YYYYMMDD to MM/DD/YYYY

Hi ,
How to change the date format  YYYYMMDD to MM/DD/YYYY .
Ex :  20071008  to 10/08/2007
Is there any function module for this ??
Regards
Rahul

Hi Sharma,
check the code:
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
SELECTION-SCREEN END OF BLOCK b2
FORM getmonth .
SELECT mnr
ktx
ltx
INTO TABLE T_month
FROM t247
WHERE spras = 'EN'.
IF sy-subrc NE '0'.
MESSAGE I "Message - Not able to get month values from the table T247
ENDIF.
ENDFORM.
DATA : temp_date(16) TYPE c,
temp1_date(60) TYPE c,
year(4) TYPE c,
daymonth(11) TYPE c,
daymonth1(11) TYPE c,
month(9) TYPE c,
day(2) TYPE c,
mon LIKE t247-ktx,
len TYPE i .
MOVE date TO temp1_date .
CONDENSE temp1_date NO-GAPS.
MOVE temp1_date TO temp_date .
IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
CONDENSE temp_date NO-GAPS.
SPLIT date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
_len = STRLEN( _daymonth1 ).
l_len = 13 - len.
SHIFT daymonth1 RIGHT BY len PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
SORT t_month BY monthltx.
READ TABLE t_month WITH KEY monthltx = month.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
len = STRLEN( month ).
CONDENSE daymonth NO-GAPS.
SHIFT daymonth LEFT BY len PLACES.
day = daymonth.
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
CONDENSE temp_date NO-GAPS.
SPLIT i_date AT ',' INTO daymonth year.
IF STRLEN( year ) NE '4'.
error = 'X'.
WRITE : 'Invalid date format.'.
ELSE.
daymonth1 = daymonth.
CONDENSE daymonth1 NO-GAPS.
SHIFT daymonth1 LEFT BY 2 PLACES.
CONDENSE daymonth1 NO-GAPS.
month = daymonth1.
CONDENSE month NO-GAPS.
TRANSLATE month TO UPPER CASE.
SORT t_month BY monthstx.
MOVE month to mon.
READ TABLE t_month WITH KEY monthstx = mon.
IF sy-subrc <> 0.
error = 'X'.
WRITE : 'Invalid date format.' .
ELSE.
CONDENSE daymonth NO-GAPS.
day = daymonth+0(2).
CONDENSE day NO-GAPS.
CONCATENATE year t_month-monthnumber day INTO o_date.
ENDIF.
ENDIF.
ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
CONDENSE temp_date NO-GAPS.
IF STRLEN( temp_date ) EQ 10.
o_date0(4) = temp_date6(4).
o_date4(2) = temp_date3(2).
o_date6(2) = temp_date0(2).
ELSE.
error = 'X'.
WRITE : 'Invalid date format.' .
ENDIF.
ENDIF.
IF STRLEN( o_date ) NE '8'.
error = 'X'.
WRITE : 'Invalid date format.'.
ENDIf.
ENDFORM. " f0100_conv_date
Reward if helpful.
Regards,
Harini.S

Similar Messages

  • How to change the date format?

    Hi,
    I need to display the data format as(YYYY-MM-DD). But now it displays(2009-1-9)
    Here is my code snippet which i used to display the data format as(2009-1-9)
    *<INPUT TYPE=TEXT NAME="date_submitted" MAXLENGTH=20 SIZE=10 VALUE="" onBlur= "return dateSubmitted()">  (YYYY-MM-DD)*
    *<SCRIPT LANGUAGE="javascript">*
    dateSubmitted()
    *</SCRIPT>*
    function dateSubmitted()
                        if (document.pgUpdate.date_submitted.value == "")
                             date = new Date();     
                             month = date.getMonth() + 1     
                             document.pgUpdate.date_submitted.value =
                                            date.getYear() + "-" + month + "-" + date.getDate();
                        return true;
    Can anybody help me how to change the date format?
    Thanks in advance!

    prit123 wrote:
    use SimpleDateFormat class. The code is :He posted a Javascript related question, not a Java related question.
    Please use forums devoted to Javascript. You're here at a Java/JSP forum.
    There are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.
    String formatPattern = "yyyy-mm-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(formatPattern);
    sdf.format(yourdate);yyyy-mm-dd denotes year-minutes-days. Please go read the SimpleDateFormat API as well.

  • How to change the date format in xml form?

    hi,
    How to change the date format in xml form?
    For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00
    Any opinions greatly appreciated!
    Thanks.
    Edited by: ke wenxing on Dec 2, 2008 8:33 AM

    You could go to System - User Profile - Own Data would take you to the "maintain user profile screen"
    Click the defaults button and change the date format.This changes date format for all the dates in your login.

  • Can we change the date format to be dd/mm/yyyy?

    Can we change the date format to be dd/mm/yyyy?

    Hello leahmaree,
    Yes, you can:
    Click the Options tab
    Click the Language & Formatting label
    Set the Date Order preference
    I hope that helps,
    Brian

  • How to change the date format in Sharepoint 2010 to dd MMM yyyy

    Hi,
    I am looking to change the datetime format with in the modified column from mm/dd/yy to dd MMM yyyy. I dont want to create calculated field with dd MMM yyyy format. I want the actual modified column value to be represented as dd MMM yyyy format.
    Thanks for your help in advance.
    regards
    Kalyan

    I'm not really sure what context you asking to change this for but to change your date time settings -
    Go into Site Settings and under 'Central Administration' there is a link to 'Regional Settings'. Click this and you specify the way dates and times are displayed.
    I have done this and mine displays as DD/MM/YYYY like you are asking.
    My locale is current set to English (United Kingdom) and sort order is general. Even if you're not in the United Kingdom, I can only see this way being your solution as US dates are always set as MM/DD/YYYY.
    http://sharepointythings.blogspot.co.uk

  • How to change the date format of Sharepoint 2010 to dd MMM yyyy

    Hi,
    I am looking to change the datetime format with in the modified column from mm/dd/yy to dd MMM yyyy. I dont want to create calculated field with dd MMM yyyy format. I want the actual modified column value to be represented as dd MMM yyyy format.
    Thanks for your help in advance.
    regards
    Kalyan

    Please ask your question in the SharePoint 2010 forum and not in this pre-SharePoint 2010 forum.
    SharePoint 2010 - General Questions and Answers
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010general/threads
    SharePoint 2010 - Setup, Upgrade,Administration and Operation
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/threads
    SharePoint 2010 - Using SharePoint Designer, Infopath, and other customization
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/threads
    SharePoint 2010 - Using Visual Studio with SharePoint and other programming
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/threads
    Dirk Van den Berghe

  • IR Job Parameters - Import bqy to a location - Append date to filename - How to change the date format?

    Hi All,
    The title pretty much says it all. We have a few jobs running that require Mon-YY appended for each month they are run. Right now it's a manual process of changing the import file name in the parameters for each month. I see that I could append the file name with date but it's not in the format I need. Has anyone been able to accomplish this? Any help is appeciated!
    Thanks,
    S

    Unfortunately, I do not have a Firefox OS device, so this is based on an old screen shot I saw in a search...
    During initial setup, you may have been asked to confirm your language and region. I believe the region is used to localize your date format. Can you find a setup app to get back to those choices? Please be advised that running a setup app may remove some data, so it's probably a good idea to wait for additional feedback before actually going forward with it.

  • How to change the date format from default to mm-dd-yyyy?

    Hi,
    There is a requirement to show the current date in an error message at the attribute level. That is, if the user input a date in a text field that is earlier than today's date, then an error message must immediately pop up with today's date in the message. To achieve this we are using a token expression in the EO ( Under Validation rules) . The token expression uses adf.currentDate to get today's date.
    The problem is that the expression extracts the date in the form of yyyy-mm-dd. What expression should I use to get the current date format in mm/dd/yyyy ? Can I modify the adf.currentDate expression in some way to get the desired format?
    Thanks,
    Anand

    You could write a custom EO method to return today's date in the specific format. Then access it via the Groovy adf.object expression.

  • How canI change the date format from mm/dd/yyyy to dd/mm/yyyy in FirefoxOS?

    I have just received and am trying out things my new Alcatel Fire E with FirefoxOS 2.0.0.0 (just updated).
    It is usual in most operating systems to be able to customize the date and time settings (amongst other things). After a few fruitless hours fiddling with the phone and checking various forums, I've come to the conclusion that this is currently not possible on my phone with this version of FirefoxOS. Or have I simply missed something?
    Achim

    ''mohd.afzal97 [[#answer-710207|said]]''
    <blockquote>
    Can u please me the method of updating phone to 2.0
    </blockquote>
    Since I don't have the old version anymore, the following might not be 100% accurate. Note that my device is in English.
    Go to the Settings app and select "Device information". You can either choose "Check now" or select "System Updates" and then "Check for Updates". If there is an update available you'll be notified. What it won't tell you is which version the new one is, at least I did not recieve that information. I thoughT I was updating to 1.4.x, not 2.0.
    You should be given the choice to either update or not. You can ignore the update if you want (like if you don't have the time, or something.
    A couple of words of warning:
    1. Make a backup of any important data first.
    2. It takes quite some time to download all the update data and this might bust your limit depending on what your service provide allows. I avoided this by doing the update whilst connected to a WLAN (also known as WiFi) which has no data restriction. This can be set in "Check for Updates > Settings".
    Hope that helps.
    Achim

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • How do I change the date format?

    Sorry, but I'm new to Oracle!
    I'm using "sqlplusw" to build my SQL statements. When I return columns that are date fields, I get the DD-MON-YY format. I want dates to be returned in "YYYY-MM-DD HH24:MI:SS". My DBA won't change the date format on the server, so how do I change SQLPLUS to return dates in the format I want? Do I need set this in some kind of startup file, or a reg key?
    Using client version 9.2.0.5 against a 9.2.0.1 server
    Jeff

    There are a couple of ways you could do it.
    Way 1:
    Search for a file by name 'glogin.sql' on your client work station and add the following statement
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure you save the file. This change will apply to all users who will log into the database using SQL*PLUS from your machine.
    Way 2:
    Create a shortcut and place it some where (for example on the 'DESKTOP').
    Right click on the short cut and choose properties.
    Change the text corresponding to the 'Start in' box to reflect the current location of the shortcut.
    Create a file by name 'login.sql' and place it in the same folder as the shortcut.
    Edit the file and add the following line.
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure that you save the file.
    When you double click the shortcut to start SQL*Plus and login, the script 'login.sql' is executed.

  • How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    Date, time and currency formats are controlled via Settings > General > International > Region Format - you can't just change the date format

  • How can I permanently change the date format from the American format to the UK's without having to constantly change it manually every time I start a new spreadsheet?

    This is my first mac so I'm still getting my bearings with it. I've only used Windows programmes before. I can't understand why it's so hard to change the date format of the cells in Numbers to keep it showing the UK format. The system preferences of the mac show that it's in the correct region and has the correct date but this doesn't seem to transfer into the Numbers program. I was very impressed with the mac until I discovered this. If anyone knows how I can get the date to stay in the correct format without having to go through the process of altering it in the cell inspector everytime then I would be very grateful.

    Numbers & most apps, especially those from Apple, use the date format you have set in System Preferences > Language & Text > Region. You can then choose UK from the Region drop-down list. Mine says Custom because I've defined things further as in the second screenshot.

  • How does one change the date format for PlayMemories Home folders?

    I am using PlayMemories Home Version 2.0.00.11271 and have many folders within it which contain only photographs imported from my Sony DSC-H9.  Unfortunately, PlayMemories Home insists upon dating all folders in a month/day/year manner; and this makes little sense if one wishes to have the folders listed in logical chronological order.  How can I change the date format to year/month/day?  Changing the name of each folder, one by one, will take a very long time!  Your helpful advice in this matter will be greatly appreciated.  Thank you. System information:
    Operating system: Microsoft Windows XP Professional
    Service pack : Service Pack 3
    Memory: 1.5 GB
    Processor:         Intel(R) Pentium(R) M processor 1.86GHz
    Max. clock speed: 1.86
    Manufacturer: IBM
    Model: 1847W76
    System language setting: English (United States)
    User language setting: English (United States) 

    I too thought that the folder naming format was obviously wrong and couldn't find a way to change it. I do agree that placing photos in folders according to when they were taken is a great idea. I had been considering writing some software to do just that. After discovering that PlayMemories does it, I had it re-import all my photos. Then I wrote a small Perl script to rename all of the folders into year-month-day format. Included here is the Perl script. It only acts on a single folder - use it on the root folder where all the PlayMemories folders are. It will rename all folders currently in a month-day-year format. I used it without problems but of course there is no guarentee that it is error free. This should work with any common version of Perl. Tom # There should be one command line argument: the directory to act upon
    if ( scalar(@ARGV) == 0 ){
     print "Usage: RenameDirs <dir>\n";
     print " Where dir is the directory containing the directories to rename.\n";
     exit;
    $mydir = $ARGV[0];
    chdir $mydir or die "Couldn't chdir to $mydir: $!";
    opendir(ROOTPHOTODIR, ".") or die "Failed to open the pictures directory $mydir: $!";
    @allphotodirs = readdir ROOTPHOTODIR;
    closedir ROOTPHOTODIR;
    foreach $dir (@allphotodirs) {
     if ( -d $dir ) {
      print "$dir is a directory";
      if ( $dir =~ /^(\d{1,2})-(\d{1,2})-(\d{4})$/ ) {
       print " and has the proper format: month $1 day $2 year $3 and will be renamed to ";
       $newname = sprintf "%4u-%02u-%02u", $3, $1, $2;
       print "$newname\n";
       rename $dir, $newname or die "failed to rename $dir to $newname: $!";
      else {
       print " but is not of the proper format\n"
     elsif ( -f $dir ) {
      print "$dir is a file\n";
     else {
      print "$dir is neither a directory nor a file\n";
    }

  • How to change the date and time during OVM installation for Fusion Apps

    Hi,
    The customer is using Fusion Instance which is a V1 (Build 19) OVM installation shipped by Oracle with Demo Data (including seeded user IDs and roles) in it.
    Now they have issue with Date format for the application on the screens is showing MM/DD/YYYY where as it should be (Singapore) Standard is DD/MM/YYYY.
    Q/A: How to change the date/time in OVM image
    Refer SR : 3-5640792461
    Regards
    Ganesh Ananthapadmanaban

    Not a problem. There are a number of other system and network setup commands that you might find useful at some time. From within the Remote Desktop Admin in the Send Unix Command window type:
    networksetup -help
    systemsetup -help
    That will give you lists of the commands, including the one I posted above, with their basic syntax. They're handy to know.
    Cheers.

Maybe you are looking for

  • 48-Hr. Film Project Nightmare

    Well, it's been quite a weekend for this editor. I was a participant in the 48-Hour Film Project - and everything was going okay until about 4pm yesterday, three and 1/2 hours before we were to deliver our finished film. At that point things went ter

  • Credit limit vs financial document

    SAP GURUS : I have taken the credit limit 20,000rs and financial doc value 10,000rs and created a sales order  for 11000rs.But 1000rs is not getting updated in Fin Doc or Credit Limit,plz let me know ASAP from where the system is taking this value?

  • Multi-Mapping in IDOC without using BPM ?

    Hi , Please check .. Can below given blog can be used to achive Multi-mapping in IDOC without using BPM ? /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible Regards PS

  • Mac Pro 8 Core and Windows Support

    Hi All, Does the average windows licensing allow Vista or soon to be released windows 7 to run on a 8 core mac sucessfully? Looking to evalute an upgrade and would like the higher end functionality of the 8 core in the system, but again if the averag

  • Loosing bindings

    when I am check out with version control (SVN) loosing the bindings of the page (views, entities bind with datacontrols). we are using jdevloper 11.1.1.0.1 and SVN. kindly give a solution