Problem with the conversion of getDate() to Date format?

Hi guys,.

I need to convert the date selected for DateField string format (for example: yyyy-mm-dd).

I put the date format DateField as "mm-dd-yyyy '.»

I tried to get the date of this DateField and tried to convert the format 'yyyy-mm-dd ".

When I tried, I had a bad outing.

For example, when I selected 12 months he returned as "00" the following coding.

SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy-mm-dd");
Date dtToConvert = new Date(mydatefield.getDate());
strRequired = dtFormat.formatLocal(dtToConvert); 

Can someone explain what that is the bug with this code or any other way to get the output as my requirement?

Thanks in advance,

Stéphane

Oops, sorry, code should have been...

DateFormat df = new SimpleDateFormat("yyyy/MM/dd");
long dateLong = field.getDate();
Date date = new Date(dateLong);
String dateString =df.format(date);

Tags: BlackBerry Developers

Similar Questions

  • What is the problem with the conversion of objects with gradients to the gradient mesh?

    What is the problem with the conversion of objects with gradients to the gradient mesh?

    Radial gradients are special, and it could become difficult edit the gradient mesh resulting.

    Take the layer apnel and inspect your objects. You will find a clipping mask the cracks inside.

  • Problems with the conversion of Word files to PDF via macro

    I have a weird problem with the Acrobat add-in. I want to convert a lot of files with the Word Add-In in PDF files. The printer is no option because it causes other problems.

    So I created a small macro for Word that transforms all the Word of a directory of files PDF files. The macro works great, but PDF files look right.

    I show you the problem with a Word file, first converted manually, then with the macro:

    First of all the image:  If the file is converted manually, it seems that the Word file and fonts are included.

    convertedManually.png

    Second picture: If the macro converts the file it doesn't seem correct and the fonts are usually not included.

    convertedWithMacro.png

    I use Acrobat XI and Word 2010. The macro command is:

    ' new name for PDF
    pdfName = Replace(Replace(verz & "\" & fi.Name, "docx", "pdf"), "doc", "pdf")
                ' convert Word into PDF
                ActiveDocument.ExportAsFixedFormat OutputFileName:= _
                    pdfName, ExportFormat:= _
                    wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
                    wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
                    Item:=wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=False, _
                    CreateBookmarks:=wdExportCreateHeadingBookmarks, DocStructureTags:=True, _
                    BitmapMissingFonts:=False, UseISO19005_1:=False
    

    I did not, but the trick is to realize you don't want specific action. Rather, you want to treat a directory. DOCX files in the directory will be converted to PDF, then actions (if any).

  • problem with the creation of my usb data card connect to a wifi hotspot network!

    Hello, I have g62005ax machine of hp pavilion and the use of windows 7 home basic service 1 since I bought it, I map of 3g data through which I use internet on my laptop, recently I had a phone android romaric mi3 and wanted to use the net to my data card 3 g on phone via my laptop by creating my cell phone as a wifi hotspot I tried connectify and virtual wifi router and mhotspot, enable me to create a hotspot wifi successfully, my phone can identify them and even be able to connect to the wifi network but I can not surf or download in the phone no matter what app or browser, phone says connected wifi network and phone receives the data as 0.15 0.58, 0.98 KB. My card data speeds work fine on pc on 1 MB/s with no problems, but what is wrong I am doing even after the connection is established?  As I said I tried different pc applications, given that my phone might have problem then I tried another star of the Galaxy samsund phone pro, it also connects to the wifi network but the same problem, IE. No surf, the so problem is not end of my phone, what am I doing wrong here?

    Hello IRON-MAN.

    Thanks for posting on the HP Forums!

    I understand the hotspot of data card USB that you create from your laptop is not working properly. I'll do what I can to help out you! Please follow this guide to make sure that you follow the correct procedures: How to create a WiFi HotSpot with your connection Internet/card USB Data...

    Please let me know your results. If you're still having problems, please provide some screen shots so I have something to look at. Thank you and have a great day!

    Mario

  • Problem with the conversion of pdf to IBR

    Hi, I have problem with IBR excel file conversion. File do not have a password, but in newspapers, I have:
    Manager of tasks/7 02.14 10:46:19.732 TaskLauncher_CmdLineConversion_44409_exsimple_stderr read 72 bytes: EXOpenExport() failed: file is password protected or encrypted (0x000B)
    Excel has macro and security for the worksheet.

    I can't find any post or information about it.
    Any idea, documentation?

    refer to http://docs.oracle.com/cd/E23549_01/doc.1111/e10800/c03_pdfi_all.htm#CIHCGCJA

    "To avoid a conversion of a file Microsoft Office expired, all functions that require a user input must be disabled. It is password protection, security notifications, such as disabling macros, and requests for online access to show online content or participate in programs of feedback from users. For more information about how to disable these and other similar goods, refer to Microsoft documentation for each product. »

  • Problem with the length of a CLOB data type

    Hello

    In my application, I have a page with an interactive report of written blogs - on this page, you can add a new blog (text box - CLOB data type), discovered a blog or edit a blog.
    There is something going wrong with the size of the blog text. I know APEX cannot accept that 32K text and I've seen the great value saving thread, but this isn't the solution to my problem.

    The problem is that when I add a blog with say about 4000 characters, it is saved in the database, but the interactive report, when I click on the view or edit icons for this blog, the blog text field appears empty. For small items (< 4000 characters), there is no problem.
    Anyone know why this is happening and how to fix this?
    Thank you!

    There seems to be a bug in the calculation of the value of the element Source when the Source Type is a SQL query and the data type of the selected column is CLOB. I'll file a bug for this. For now, I have demonstrated how you can use a type of function PL/SQL source instead. Please see point P3_TEXT:

    beginfor c1 in (select blog_textfrom blogwhere blog_id = :P3_BLOG_ID) loop  return c1.blog_text;end loop;return null;end;
    

    Scott

  • Problem with the two EA DEVELOPER SQL DATA MODELING 3.0.0.665 and 3.1

    I created a model of very large data using SQL Developer data 3.0.0.665 and 3.1 EA maker. Its having a lot of check constraints. Whenever I am the design of the fence and the DOF and reopening export to import the DDL file failure to import completely check constraints. It is important to check constraints, but without any range of values inside. Its very frustrating because whenever you open import ddl, you must manually add again all the details of data check range constraint.

    OS: Windows XP.
    Check in the two EA Developer SQL Data Modeler 3.0.0.665 and 3.1

    -------------------------------------------
    Here are the contents of the .dmd file.
    -------------------------------------------
    * <? XML version = "1.0" encoding = "UTF - 8"? > *.
    * < OSDM_Design class = "oracle.dbtools.crest.model.design.Design" name = 'Admin_Panel' id = "9BE18B0A-6C67-2E5B-00DE-BD8312189ECB" version = "3.41" > * "
    * < createdBy > administrator < / createdBy > *.
    * < Createduserid > 2011-10-17 08:32:18 UTC < / Createduserid > *.
    * < Admin_Panel ownerDesignName > < / ownerDesignName > *.
    * < false capitalNames > < / capitalNames > *.
    * < designId > 9BE18B0A-6C67-2E5B-00DE-BD8312189ECB < / designId > *.
    * < / OSDM_Design > *.

    -------------------------------------------------------------------------------
    An example how the check constraints to get dirty.
    -------------------------------------------------------------------------------
    Initial check constraint is as below:
    ======================
    ALTER TABLE test_table
    ADD CONSTRAINT Active_Flag_ck
    CHECK (Active_Flag IN ('A', 'I'))
    *;*

    Below how it occurs once I have imported the ddl and re-export:
    ============================================
    ALTER TABLE test_table
    ADD CONSTRAINT Active_Flag_ck
    (CHECK)
    *;*

    I'm in trouble as I already in the middle of the my development using SQL Developer Data Modeler.

    Please help me soon.

    Jean

    Hi John,.

    Every time I'm fence design and export the ddl and reopening through the import of the DDL file

    Why are you doing this? Once the DDL file is imported and then save the drawing and open simply saved design, no need to generate the DDL and import it every time that you start Modeler data.
    On the list of values - forced as this CHECK (Active_Flag IN ('A', 'I')) are imported as constraint check plain and not as a list of values.
    There are the more specific elements import of check constraint - they are defined as type database constraint that you select during the import. Accordingly if you import your DOF as Oracle 10 g DDL, then you will get forced correct check in DDL generated for Oracle 10 g and Oracle 11 g. Constraint of evil will be generated for Oracle 9i. You can move the constraint for Oracle 9i (in the check constraint dialog box) or generic if it can be treated as such constraint.

    I logged for DOF bad bug.

    Philippe

  • Download data - problems with the conversion of the date

    Hello

    I have a picture that I downloaded from a database of oracle using SAS. It has a column with dates in the following format: 10/31/2012 11:00

    When I download the data (via workshop SQL-> utilities-> data workshop-> load data) by categorizing my dates as varchar2, everything works fine... but fails when I choose my type in the Date column.

    Please advice how to fix this

    Thank you

    K I import my data with other tools. Looking at the workshop of data utility, no doubt you would put MM/DD/YYYY HH: mi: SS AM in the 'Format' field for this column.

  • Problem with the conversion date by default.

    Hello

    I use JDeveloper 11.1.1.3. I have a 'read-only through sql access' VO in which I defined a query to retrieve the attribute "issuedate" of a table. The query is as follows:
    select to_date(issuedate,'dd-Mon-yyyy') issuedate from administration_circulars
    I tried using a spreadsheet sql and it worked fine (for example, it returns 'January 16, 13')

    However, in my application, I have a system on a chip to display this attribute. When I try to launch the application, I get "13/01/16. Anyone has any idea on this? I even tried to change the format from data of the user interface in the view object to 'none' so far so 'simple' value 'dd-Mon-yyyy', but it works at all.

    Thank you

    Mohamed.

    Have you tried it in a sql worksheet?
    It should return the date in the format as a string.

    Timo

  • Problem with the conversion of the date

    Hello

    I have a column called period_name which is of type varchar which contains data as jan-02 Feb-03 and 05-02, now my requirement is I want convert month names number say jan-02 to 01-02.

    I tried to use to_char (to_date(period_name,'mm/yy'), 'mm - yy') which gives good results to the selection, but when I use the same creation then Sunrise error


    [Error] Run (58:24): ORA-01858: a non-digit character was found here where was waiting for a digital


    Query:

    create the table dumm1 as
    (
    Select to_char (to_date(period_name,'mm/yy'), 'mm - yy') in the period_name of xx_alll
    )

    Concerning

    Published by: 862807 on June 13, 2011 03:30

    862807 wrote:

    Here when I write a select statement which I produced earlier works fine, but when I write the same create in her statement generates an error.

    No it's not.

    You're not extract all lines, you use Toad or some other GUI to confuse you. Enter the results data grid and type CTRL + end to fetch the last row. Or use sqlplus. The selection will fail too.

  • Problem with the conversion of Midlet (jad/jar) cod file (Jasymca 2.0)

    BB Storm last official OS.

    There is this wonderful program called Jasymca 2.0 which is a combination of programs of mathematics MATLAB and MAXIMA of high-end (subset to fit) and written in J2ME as a MOPED. To see a demo of it, go to http://webuser.fh-furtwangen.de/~dersch/jasymca2/indexEN.html and click on demo on the left. It's quite impressive... able to make the symbolic math and math matrix among others. The ultimate calculator for a PDA... and the best I could find out there.

    The only problem is that it is written in J2ME as a MIDLET and the runtime is stored as a combination of jad/jar. Now, I tried the standard conversion using the CAP as follows...

    CAP import = "C:\Program Research In Motion\BlackBerry JDE 4.7.0\lib\net_rim_api.jar" code name is jasymca-midlet jad is Jasymca.jad Jasymca.jar

    It seems to work very well. There are a few warnings about unused variables, but that's fine. The last line was "No Errors".

    .. .and he left me with a file .cod 229K

    When I insert it in my blackberry through javaloader, it loads very well.

    However, when I look in my download directory I 2 files related to Jasymca and not running.

    I suspect that it is because the cod file is too big. Is there another step I can do for the cod of the loadable file?

    Any help is appreciated.

    Thank you

    -Donald

    It takes more time than I expected.

    There is a preprocessor directives in the source files and to leave JDE to understand these guidelines, I need to modify the jdp.

    I stopped the investigation

    But I will say that I found.

    icons and data files must be located in the default folder.

    If the root folder of the package is src\

    path of the icon should be: src\myicon.png

    for now the icons are located in the src\icons folder

    in this case the image files are not accessible from the BlackBerry App.

    The second: there are some files showed up as the symbol file name first.

    JDE does not add these files to the project.

    I think that the best way would be to contact the developer of Jasymca and talking to him about the Jasymca and porting for BlackBerry

  • problem with the history of EEG waveform data

    Hello world:

    I use SIT to create a user interface in Labview to communicate with a simulink model. After I configure the SIT connection manager and run the vi, the output was displayed in waveform graph.

    Now, I want to get all the data in the history of the map of waveform. I tried to use the graphic story property node to access the whole of the historydat. But nothing copied in the part of Y in the front of the cluster of waveform...

    Can someone give me a helping hand on what is the problem? or has anyone encounter the same problem when you use SIT.  I am really confussed...

    I've attached the vi, but to run the vi, you must have a simulink model corressponding and SIT, so I'm really sorry that you can not run it

    And thanks a lot a lot a lot for that.

    / Shangning

    I just realized this data is a 2D waveform table, which contains the waveform 2000 * 1, and each waveform data contains only 1 value of Y.

  • Problem with the conversion of Partition Boot Camp

    I would have just dl and installed the trial version of 3.0.  After running and by selecting the boot camp for the boot partition, merge began to 'prepare' the partition for use.  After about 45 minutes, the process had not been completed.  I grew up the activity monitor and found that the process did nothing.  I closed the process, thinking I could start over again at the launch of Fusion.  Wrong, merger saw the partition boot camp into a virtual machine that could not be started.

    Is there a possible way to start the process of 'preparation '?  It is apparently the only way to correct the problem.

    Tried from a support ticket, but could not do while I wasn't a registered owner.

    I'm trying to make my choice between Parallels and Fusion, or just stick with BootCamp.  I hope someone can help me with this problem.

    Harry

    Dear Harry,

    I did the same thing yesterday. My BootCamp partition has Windows XP (SP3) and I also have Parallels. I'm now trying to decide if I stay with Parallels or Fusion 3 (to take a possible advantage over the 64-bit @ Snow Leopard).

    My upgrade was fine, it took about 15 minutes to get BootCamp running on the merger. A small step has been to re - activate my XP with Microsoft license, because the "material" changes. I have the MACBOOK PRO 13 '' 2.53 with 4 GB of RAM. I don't really have time to play yesterday, but between Parallels and Fusion 3, (64-bit), I did not see too much improvement on the 'speed '.

    An advantage of having any of virtualization software, is that you can have multiple operating systems running, such as XP, Windows7, etc. I need that because my work, the developer. If you can stay only with an operating system, I guess, BootCamp works very well.

    Kind regards

  • can I fix a problem with the window through transfer of data? (portable laptop 2)

    my laptop doesn't have a Cd so I have to use an external. I just wanted to know if I can use a cat5 from my laptop to my friends (because he had a cd player)

    Depends on what exactly you want to do, the State of Windows on the laptop and the ability of the network adapter on the laptop.

    If you want to install Windows, with Windows does not at all on the laptop and the laptop a compatible NIC PXE (check by looking at the BIOS boot options), then take a look here-->http://www.lockstockmods.net/2008/05/26/easy-way-to-pxe-boot-windows/

  • Problems with the conversion of files to the word

    I recently downloaded the judgment of Adobe Acrobat Pro XI for the possible purchase of my company.  I would like to convert it the letters that I worked with for Word while trying to work in Adobe.  When I did this, changed the dynamics of the letter.  It likely to change the letters, or even come as winddings.  What I am doing wrong?

    What I am doing wrong?

    Nothing. You simply overestimate the powers of the process. This is an approximation, but 90% time of manual editing and cleaning of files that results is necessary.

    Mylenium

Maybe you are looking for