Format SQLite DateTime in QML

Hi all

I'm sorry if this is an easy/stupid question. But I can't get the updated date retrieved from an SQLite database object shaped properly.

I found the TwitterTimeline example, but they released only this. I want to format as exact in my ListView.

I thought I could standard Javascript like this:

StandardListItem {
  reserveImageSpace: false
  title: {
    ListItemData.sys+" : "+ListItemData.dia
  }
  status:{ (new Date(ListItemData.measure_date)).getFullYear(); }
}

and toString() methods and so on, but I only retrieve the outputs "nan".

Then I tried without the 'new Date()' conversion, maybe b/c it is already converted to a new date, but get no results.

Can someone help me on this? I'm quite new to BB 10/stunts, but he really likes to use it.

Thank you very much!

So it seems to me that the part in the QML is not Javascript, at least, it seems that the Date functions do not work.

So I took a different path and made my custom objects, filling a SQL GroupDataModel inside and these custom objects custom objects I make the date formatting.

Maybe it helps someone else, too.

Tags: BlackBerry Developers

Similar Questions

  • What is the format of DateTime in IPD file blackBerry smart phones?

    I want to analyze the format of SMS Message in IPD file.

    I sent an SMS Message with 'Test' content at 10086 at May 18, 2010 14:16:17 (GMT + 8), then I found the block of DateTime data that is stored in the file IPD is 81 49 6F EA 27 01 00 00', Low Dword of DateTime is 0x6FEA4981 the high Dword of DateTime is 0 x 00000127.

    I want to know how to convert this double Dword value date actual time.

    The format of SMS Message:

    Thank you.

    lhermite wrote:

    I sent an SMS Message with 'Test' content at 10086 to May 18, 2010 14:16:17 (GMT + 8),.

    Thank you.

    Tip. Can I borrow your time machine?

    The value is 1268892977537.

    A little work in a spreadsheet tells me that it is the number of seconds since 01/01/1970.

  • How to set the display format for datetime field in a page jspx

    Hi, jdev 11.1.2.3
    have an EO/VO field set to DateTime format and can see the right screen in the Oracle ADF Model tester.
    but only displayed in the format of Date had been set to "javax.faces.DateTime" for the attributes property for the field palette converter.

    What should I do?
    Thank you.

    did you mean like this?


    Type = "both" / >

  • problems of date format SQLite

    I am trying to format a date that is stores database local ina. Starting step function seems to return everything I get empty. Here is an example.

    Select strftime ("%m / %d / %Y ', 'mytime'") of record_table

    retrieve the value first, then edit/format.

  • BUG: Date/Time Format string with %D in the format string crashes LabVIEW

    Do %D in the format string 'Format string DateTime' blocks LabVIEW 2009 SP1, as shown in this code snippet.  Should I use instead of %D %d but an incorrect format string should not crash LabVIEW.

    Fixed in 2010.

  • What do you see when you run that this basic example ListView QML?

    I read through the examples of ListView found here:

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__ListView.html

    I'm at the part that speaks of "'How to create a list in QML and access a variable inside the ListView". " When I run the example, I see a ListView display the data I entered model.xml.    But must I also see "Example text" added on each entry in ListView?    I don't see "Example text" displayed anywhere.

    The property type must match the xml in the template tag, for example:

    Using this model in xml format:

    
      

    With this qml code works perfectly:

    import bb.cascades 1.3
    
    Page {
        ListView {
            property string myText: "is a City"
            dataModel: XmlDataModel {
                source: "model.xml"
            }
            listItemComponents: [
                ListItemComponent {
                    type: "item"
                    CustomListItem {
                        id: itemRoot
                        dividerVisible: true
                        highlightAppearance: HighlightAppearance.Full
                        Container {
                            Label {
                                text: ListItemData.title + " " + itemRoot.ListItem.view.myText
                            }
                        }
                    }
                }
            ]
        }
    }
    
  • How to convert string to datetime in the transformation of the Ombudsman

    Hello

    I am getting error below when inserting the data in the database using the database.

    Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run reference"insert"operations have to: DBWriteInteractionSpec Execute Failed Exception." insertion failed. The descriptor name: [InsertPayload.XxohInsertStgTable]. Created by Exception [EclipseLink-3001] (Eclipse - 2.3.1.v20111018 persistence Services - r10243): org.eclipse.persistence.exceptions.ConversionException Description of the Exception: object [2015-09-14 15:19:51], class [class java.lang.String], couldn't be converted [class java.sql.Timestamp]. Inner exception: LINK. JCA-11636 couldn't convert Timestamp Exception. Cannot convert a string value in the xml file to a java.sql.Timestamp. Although the databases accept strings representing the timestamps in a variety of formats, the adapter only accepts strings that represent xml ISO dateTime format. The input value must be in the format XS: DateTime to iso 8601, i.e. YYYY-MM - DDTHH:MM:SS.sss - 07:00. Please see the logs

    In the transformation of the mediator, the Source element is a string

    < xs: element name = "CREATED_DATE" type = "xs: String" > < / xs: element >

    Target is of type dateTime

    < xs: element name = "Creation_Date" type = "xs: DateTime" minOccurs = "0" nillable = "true" / >

    To avoid the above error, I used < xsl: value-of select ='xp20:format - dateTime (/CREATED_DATE, "[Y0001]-[M01]-[D01] [H01]: [m01]: [s01]")'/ > in the transformation, but its does not work. The value is blank display after processing.

    Please suggest me how to solve this problem.

    Thank you

    Sunita

    Unfortunately, the format required by the dateTime format is YYYY-MM - DDTHH:MM:SS.sss

    You can use the substring, and on the entry's concat function to create YYYY-MM - DDTHH:MM:SS.sss

    See formatting string to date in BPEL

  • Conversion of the time/date STAMP backup to the DATE format?

    Hello community,

    is it possible, to convert the backup timestamp Format (which is written by RMAN in the columns titled "STAMP" in NUMBER data types) in a regular Format of DateTime?

    I can't find any data about this timeformat only this:

    'specifies that the backup the value timestamp, which is a 4-byte value derived as the number of seconds since a reference period fixed'.

    But what kind of 'fixed reference time' is it?

    I would like to show the output of the view RC_RMAN_OUTPUT of the RMAN catalog with a timestamp of humanreadable for each line of output, but there is only one column of STAMP.

    Thank you

    Tobias

    I found for myself:

    Select

    (to_date('1987-07-04 00:00:00', 'YYYY-MM-DD HH24:MI:SS') + STAMP, 24, 60, 60) log_date,.

    output

    of rc_rman_output

    order by recid;

  • formatting oracle.jbo.domain.date

    Hello

    I use JDev 11.1.2.4.

    I'm trying to update VO with the current date and time by using the code below.

    DateFormat df = new SimpleDateFormat ("YYYY/MM/dd HH: mm :"); ")

    java.util.Date currentDate = new java.util.Date ();

    row.setAttribute ("Date sent", df.format (currentDate));

    However, I run error

    Houston-27023: Impossible to validate all the lines in a transaction.

    any ideas?

    Thank you

    Hello

    When you define the attribute that you do not need to set the format of datetime.

    If you want to set the attribute to current date time use this

    If the attribute is of type Timestamp, you can set date current time like that

    row.setAttribute("ShippedDate",new oracle.jbo.domain.Date(new java.sql.Timestamp(System.currentTimeMillis())));
    

    If the data type of the attribute is oracle.jbo.domain.Date you can set the date current time like that

    row.setAttribute("ShippedDate",new oracle.jbo.domain.Date(oracle.jbo.domain.Date.getCurrentDate()));
    

    and to display that date in the page with the format DD/MM/YYYY HH: mm: follow these steps:

    1 - Open the viewobject and select Date sending attribute.

    2 - starting from the indications of the UI, tab set Type-> Simple Date Format

    3. as text the value of-> MM/DD/YYYY HH: mm:

  • TreeControl: Is rapid methods of population and the update?

    'Hi,

     

    As many of you already know, the TreeControl in LabVIEW performs poorly when it comes to dealing with thousands of articles.

     

    For those who are a little used software in some corners of the automotive industry, I would like to create an application that mimics the spy vehicle monitoring window and so I need to have a tree that is quite sensitive.

     

    Basically I have a reception RX Analyzer CAN PEUT managers, these executives are divided into signals

     

    Format

    -DateTime; Name of the image; Content of the framework (HEX); Vacuum (node: level 1 of the hierarchy)

    -Empty; Name of the signal; Value of the signal; Unit (node: level 2 of the hierarchy)

    -- ...

     

    -Chassis 001; 0 12345678 x;

    -Signal 11;  ...

    -Signal 12;  ...

    -Signal 13;  ...

    ...

    -Signal 2F;

    ..

    -Framework FFF; 0 12345678 x;

    -- ...

     

     

    I know many who have tried to solve this problem, but seems it is pretty a pain to get decent performance when dealing with thousands of articles.

     

    All simply by deferring updates on the façade while adding nodes, use the method to add several items to the end (Incidentally, I strongly suspect that there simply a report on the TreeControl, cause performance with two meanings seem pretty similar).

     

    In any case, two of these solutions are not only effective CPU... In addition, I also tried to play with asynchronous display, but overall, nothing is really done.

     

    Any idea to add items and update values (approximately every 10 ms) on such a broad set of data (thousands of items)?

     

    Please find attached with a sample only the nodes of level 1.

     

    References:

    - https://decibel.ni.com/content/docs/DOC-4519

    - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Improve-Tree-Control-Performance/idi-p/1067286

    - http://forums.ni.com/t5/LabVIEW/Tree-control-best-fast-way-to-initialize/td-p/2571327

    "

    There are update reporter, property of the Group of experts that you can set to true prior to several updates command and then it back after. But it's not not going give you sub speed of 10ms. You will need to make some smart update only updates the part that is currently visible to the user and adding elements as the user develops tree leaves or scrolled around. Thousends of items every 10 ms update will NOT work in any UI widget library I know.

  • Working with complex data types in web services...

    Hi all
    I have created a Web service and created an interface for this in the ADF. Now that my web service returns a complex data type, I followed the steps in this article "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" and it works very well, my results are also displayed. But the only problem is that I get a warning "Houston-25009: cannot create an object of type: java.util.calendar value: 2008-09 - 23 T 23: 51:30.000 + 05:30 ' and if I can replace all the java.util.Date oracle.jbo.domain.Date then I get a warning" Houston-25009: failed to create an object of type: oracle.jbo.domain.Date with the value: 2008-09 - 23 T 23: 51:30.000 + 05:30. Now I am unable to understand this, but I think it's a problem of data type mapping, but do not know how to remedy this.

    Everyone knows the wayout?

    Concerning
    Lokesh

    Hi Lokesh,
    I have been troubled by the same question in the past. The problem is that the entrants is a format for dateTime xml adf trying to analyze the underlying java object. Java.util.Calendar, java.util.Date, or oracle.jbo.domain.Date to get a date in adf when scanning automatically your incoming xml file. See this thread on the forum for more information jdeveloper Re: how to deal with xsd: DateTime to webservice in ADF? The answer that gives Frank Nimphius is correct but I used option 1 option 2 should also work.

    Kind regards
    André

  • What is the DateTime format, when you insert data in the DateTime column in the DB?

    Hi all

    I can't find an example to insert data into db that contains a DateTime column. I tried different date format, but none of them works. Someone has an idea how to do that? Is there a sample project?

    Thank you

    Dong

    Thanks for your reply, I'll check and give it a try.

    Dong

  • OBIEE error - Datetime-01-01 value does not match the specified format

    I get this error after the promotion of Production. It works perfectly well on the Test Server.

    I am using SQL server. After launching the date as a varchar, it works fine.

    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 43113] The message returned by OBIS. [nQSError: 43119] Query Failed: [nQSError: 46046]-01-01 Datetime value does not match the specified format. (HY000)

    Gurus of OBIEE please help

    JD

    I found the solution as well.

    The Windows Server ODBC driver was old (Version 6). I have who has upgraded to SQL Server Native Client 11.0 and everything works fine.

  • SQL Loader with BCP datetime format

    Hi, Im having trouble loading of data from sybase to oracle may. I already .dat for my lens. However, its datetime column has changed its formula and it is not accepted to oracle.

    Please see below.

    Source table

    PUP_DATE

    ------------------

    2014-10-01 10:34:07.613

    PUP_DATE = datetime (sybase - source table)

    target table for pup_date data type is TIMESTAMP

    When my sybase database are imported via bcp on looked this way date format .dat file

    .dat file

    ....

    < EOFD > 1000017962 < EOFD > Oct1 2014 AM < EOFD > 10:34:07.613

    ...

    bcp sql developer-generated command line

    BCP dbname.dbo.table_name /directory/test.dat - c t '< EOFD >' - r '< EORD >' - Usa - Ppassword - Sservername

    What can I do to keep its format which is accepted at oracle?

    I tried to change the date and time stamp of mask in sqldeveloper migration options. also the mapping of datatime timestamp data type.

    Thank you!

    The following shows how to use TO_TIMESTAMP in your SQL * control file loader to load your test.dat file data in a column of timestamp into a target of Oracle table.

    Scott@orcl12c > test.dat TYPE of HOST

    1000017962Oct1 2014 10:34:07.613 AM

    Scott@orcl12c > test.ctl TYPE of HOST

    DOWNLOAD THE DATA

    Test.dat INFILE

    IN the purpose of the TABLE

    FIELDS TERMINATED BY ''.

    TRAILING NULLCOLS

    (fill1 FILLER

    fill2 FILLER

    ', pup_date ' TO_TIMESTAMP (: pup_date, ' MonDD YYYY hh.) (FF3AM') ')

    Scott@orcl12c > CREATE TABLE target

    2 (pup_date TIMESTAMP)

    3.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = test.ctl LOG = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Wed Jan 7 12:05:18 2015

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 1

    TARGET table:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > SELECT * TARGET

    2.

    PUP_DATE

    ---------------------------------------------------------------------------

    1ST OCTOBER 14 10.34.07.613000 AM

    1 selected line.

  • convert datetime to decimal format

    Does anyone know how to convert a datetime (as 2015-06-10 07:30) in a decimal number that is similar to:

    42165.450 where 42165's days and 450 is minutes?  If I try the following:

    ------------------------------------------------------------------

    < cfset dtNow = '2015-06-10' / >

    < cfset dtOne = CreateDateTime)

    Year (dtNow)

    Months (dtNow).

    Day (dtNow).

    07, <!--> 18:00

    30, <!---30 minutes. ->

    00 <!---0 seconds. ->

    ) / >

    <!-empty result. ->

    < cfdump var = "#NumberFormat (dtone, '99999.99999') #" / > < br / > ""

    ------------------------------------------------------------------

    I find myself with 42165.31250

    Thank you

    Padding with zero is not the answer. What you write in fact comme.720 et.1218 are, in fact, not decimals.

    As you suggested, 720 and 1218 values represent for several minutes. Thus, the duration, in minutes, for dates (2015 - 06-16 at 12:00) and (2015 - 06-16 at 20:18) are, respectively, 12 x 60 = 720 and 20 x 60 + 18 = 1218. You can solve the problem in 2 ways:

    1)

    Interpret values 42170 / 720 and 42170 / 1218, respectively, as 42170 + 720/1439 =42170.500 and 42170 + 1218/1439 =42170.846

    2)

    Take a step back to my last post. You can determine the date reset your system as follows.

    You know that the date (2015 - 06-16 at 12:00) equals (42170 days + 720 minutes) after the date of zero. Everything by converting the minutes gives (42170 x 24 x 60 + 720) = 60725520 minutes. You then

    Zero date: #dateAdd("n",-60725520,myTestDate) #

    This tells you that your zero date is 1899-12-30 23:00, which equals createDatetime (1899,12,30,23,0,0). You can then use that date zero as the basis for all other date calculations.

    Suppose you want to find a date corresponding to the format number_of_days / number_of_minutes, for example, 42170 / 1218. All you need to do now is convert everything in minutes and add to the zero date. Therefore,.

    #newDate #.

Maybe you are looking for