Convert the date in milliseconds

Hello

I am trying to write a function to create an event on the calendar

the function takes at the beginning of the year, month, day and time. Also the end time

EventList eventList = (EventList) PIM.getInstance () .openPIMList (PIM. EVENT_LIST, PIM. WRITE_ONLY);
Event e = eventList.createEvent ();
e.addString (Event.SUMMARY, PIMItem.ATTR_NONE, "The Gym");
e.addString (Event.LOCATION, PIMItem.ATTR_NONE, "Gym");

dates back to January 1, 1970
e.addDate (Event.START, PIMItem.ATTR_NONE, startDate);
e.addDate (Event.END, PIMItem.ATTR_NONE, endDate);

I'm stuck trying to figure out how to convert, say, an entry 2013 (year), 3 (months), 7 (day) in millisecond so that I can

Put it in the field hiring date

Thank you

2 options:

(1) use a Calednar object, use the methods of 'set' associated with it to set the year, month, day, etc. (not to mention the January is month 0) and then get the Date in that and then the time from the Date.

(2) format your date so that it is acceptable to HttpDateParser and the race that against your date string.

Tags: BlackBerry Developers

Similar Questions

  • How to convert the date in milliseconds?

    Hi all

    Can I know how to convert the date in milliseconds?

    My current datetime like this Formate

    QDateTime::currentDateTime (m:System.NET.SocketAddress.ToString ("MMMM dd, yyyy HH"))

    Seconds since January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toTime_t

    Sinds milliseconds January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toMSecsSinceEpoch

  • How to change the date in milliseconds

    Hello guys, I worked on a new project where the user add his birth date, I want some type of validation to check if the user is personal good brith 'date of day or the futuer even not", the user date conclude filed is in this format" "2013-07-05 to the validation that I change in milliseconds.". "

    Is it possible to change the date in this format in milliseconds?

    or any other way to make the validation

    Thanks for help

    After 2 hours, I'm dating a solution by myself, however the function can be customize to check if the user enters on the right date.

    function findtAge(subjectName,fromdate, todate) {
        console.log("findAge(fromdate, todate) is called now "+subjectName+"-->"+fromdate+"-->"+todate);
        if(todate) todate= new Date(todate);
        else todate= new Date();
    
        var age= [], fromdate= new Date(fromdate),
        y= [todate.getFullYear(), fromdate.getFullYear()],
        ydiff= y[0]-y[1],
        m= [todate.getMonth(), fromdate.getMonth()],
        mdiff= m[0]-m[1],
        d= [todate.getDate(), fromdate.getDate()],
        ddiff= d[0]-d[1];
    
        if(mdiff < 0 || (mdiff=== 0 && ddiff<0))--ydiff;
        if(mdiff<0) mdiff+= 11;
        if(ddiff<0){
            fromdate.setMonth(m[1]+1, 0);
            ddiff= fromdate.getDate()-d[1]+d[0];
            --mdiff;
        }
        if(ydiff> 0) age.push(ydiff+ ' year'+(ydiff> 1? 's ':' '));
        if(mdiff> 0) age.push(mdiff+ ' month'+(mdiff> 1? 's':''));
        if(ddiff> 0) age.push(ddiff+ ' day'+(ddiff> 1? 's':''));
        if(age.length>1) age.splice(age.length-1,0,' and ');
        console.log("===============================");
        console.log("Subject age is = "+age.join(''));
        console.log(" age Day = "+ddiff);
        console.log(" age Month = "+mdiff);
        console.log(" age Year = "+ydiff);
        console.log("===============================");
        var subjectAGE =  age.join('');
    
    }
    

    Thanks a lot guys for the helpful answers

  • convert the data-&gt; layer mask vertex position position

    I have 2 videos (A; (B) whose corresponding value of markers, I need to distort the video so the position of the markers would correspond to the position of the corresponding markers in video B.

    The markers are easy to spot, but I can only request data followed the anchor layer,

    while I can use for the distortion (Reshape, revision deform or Morph) the tools work with masks.

    I need a way to convert the caterpillars position data to control individual mask points.

    Someone knows or can write this script?

    much help appreciated

    Yes, as David said, with local Tracker2Mask mode, you can move individual points mask with track points of the tracker item AE.

    See this tutorial:

    Tracker2Mask - advanced functions and local change mask | mamoworld

    My MaskTrackerPlus not help not in this particular case, since he cannot move together masks, but individual vertices not independently.

  • convert the data that are not text

    create table x as
    (line_1 varchar2(10))
    INSERT INTO x  VALUES ('001165899', '0506', 'ZIP1003', 'ABC', 'xyz')
    It is the source table, it transforms (to meet the requirements of the company) to another table where column line_1 is converted to a data type of number, and all the data in the column of line_1 which is the text are converted to-1.

    user628919 wrote:
    How the hyphen may be replaced for the data where it grows in different places within the data.

    The solution needs to keep other rules - convert to_number, text-1 column, ignore nulls (see below)-, more remove the hyphen of digital data.

    to_number(regexp_replace(line_1, '.*\D.*', '-1'))
    

    As Vivek L, complete with a convenient link for documentation, said "replace should work.

    to_number(regexp_replace(replace(line_1, '-'), '.*\D.*', '-1'))
    

    John

  • tool to convert the data to a script

    I have a list of posts with the following data
    EmpNo, name, date of birth
    12345, kala, August 25, 1960
    23456, anugraha, 05-mar-1991
    34567, marie agegee, July 1, 1984

    I want to send this data to another area where the staffing table exists with the same structure.
    That's why I need script like the following file

    Insert in the values of staff (12345, "kala", August 25, 1960 "");
    Insert in the values of staff (23456, 'anugraha','05 - mar - 1991 "");
    Insert in the values of staff (34567, "marie agegee", July 1, 1984 ');

    I can run this script to load data into this new personal table under different domain.

    Transaction every day, I want to create this script file and store it in different domain.

    Y at - it a facility to convert my data as above the script file instead of write procedures using cursors.

    In Oracle SQL Developer, you can right-click on a table and export data as INSERT queries, among other formats.

    Thank you

    -Scott-

    http://sumnertechnologies.com/
    http://spendolini.blogspot.com/

  • Open or convert the .dat files

    How to open image files that have a file extension ".dat".  I have Windows Vista and most of the photo files are .jpg, .gif

    You may be able to view the .dat file if you rename in .jpg.

    Also... the free software IrfanView can be able to open the file:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    IrfanView and IrfanView plugins
    http://www.download.HR/download-IrfanView.html
    (scroll down a bit for the download links)
    (Download plugins too)

  • Oracle: Use LEFT OUTER JOIN, but convert the data to an external list

    Hello, all,.

    I know it can be done; I just don't remember how I got it done, oh there are so many years.

    Assumes that the tables exist for groups and individuals.  People can belong to several groups.

    SELECT g.groupName, p.lastName || ', ' || p.firstName as fullName
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON gpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    ORDER BY g.groupName, fullName
    

    This gives us:

    Group One          Alpha, Daniel
    Group One          Bravo, Charles
    Group One          Charlie, Chuck
    Group Two          Beta, Alpha
    Group Two          Delta, Bonnie
    Group Three        Echo, Bunny
    Group Three        Golf, Samuel
    Group Three        November, Stan
    

    How word the SQL to get the data as:

    Group One          Alpha, Daniel | Bravo, Charles | Charlie, Chuck
    Group Two          Beta, Alpha | Delta, Bonnie
    Group Three        Echo, Bunny | Golf, Samuel | November, Stan
    

    V/r,

    ^_^

    I finally thought to it.  I was using incorrect keywords on Google.

    SELECT g.groupName, LISTAGG(p.lastName || ', ' || p.firstName,' | ') WITHIN GROUP (ORDER BY g.groupName) "fullName"
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON ggpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    GROUP BY g.groupName
    ORDER BY g.groupName, fullName  
    

    Just in case someone else is going through this same desire.

    HTH,

    ^_^

  • Function to convert the Date?

    Hai Experts,

    I need to write a function,

    Input to the function will be a date format.

    If I give the date in DD/MM/RR format the return value must be DD/MM/RR HH24

    If I give the date format as MM/DD/RR the return value shall be MM/DD/RR HH24

    The function may return multiple lines.

    Kind regards

    Millar

    No need for a function. This will do:

    Select decode (, ' DD/MM/RR", to_char (sysdate, ' HH24 JJ/MM/RR ')," DD/MM/RR", to_char (sysdate," DD/MM/RR ' "),"invalid format") of ;

  • Convert the date of "MON/dd/yy" format to "LUN/yy '.

    I know there is probably a load of questions already on it, but I can't find a simple simple explanation with examples on how to change the date format "MON/DD/YY" in month/year format "LUN/YY '.

    Can someone help with a useful answer, thank you

    woof777 wrote:
    I know there is probably a load of questions already on it, but I can't find a simple simple explanation with examples on how to change the date format "MON/DD/YY" in month/year format "LUN/YY '.

    Can someone help with a useful answer, thank you

    The DATE data type have No. format, & can be presented with TO_CHAR sort

    SQL> select to_char(sysdate, 'MON/YY') from dual;
    
    TO_CHAR(SYSDATE
    ---------------
    AUG/12
    
  • Convert the data to uppercase (upper/lower case text

    I have data in the field as
    ABERCHROBIE FITCH - like this

    I want to change all the data in the field, as
    Aberchrombie Fitch - first letter should b in the capital and all the remaining letters should be in small.


    Ex:
    FITCH-> Fitch
    Concat (Upper (Left(columname,1)), LOWER (SUBSTRING (columnname OF 2 for LENGTH (columname)))

    ABERCHORMBIE FITCH Aberchrombie - Fitch
    ?

    AMERICAN EAGLE-> American Eagle
    ?
    ....

    can someone help me change the first letter to the capital and the remaining letters to small

    Published by: user12255470 on October 18, 2010 18:49

    user12255470,

    under fx, apply the formula: LOWER (your column)---> the result which is "abercrombie fitch.
    now go to "Properties of the column" and select "additional formatting" options > check "Use CSS Custom Style" & put the style according to

    text-transform: capitalize;

    If the answer points please :-)

    -bifacts
    http://www.obinotes.com

  • How to convert the Date 2010 - 02-20T 00: 00:00.00 - format 00:00

    Hello

    In my application, I have a single field. Here the user can select the date by using the calendar dropdown.

    While sunmitting the PDf I want to spend the date like this format 2010-02-20 T 00: 00:00.00 - 00:00

    everyone is to have an idea.

    Concerning

    Moustapha

    Try this... Language is FormCalc.

    A hidden text field and place the code in the output of the Date below field event.

    Replace Date() and Time() below with the appropriate field values.

    $

    = Concat (Num2Date (Date (), "YYYY-MM-DD"), "T", Num2Time (Time (), 'HH'));

    Thank you

    Srini

  • How to convert the Dates of entry into ReminderInfo in observed activity!

    Hello

    We read the Date and time of the reminder of the user via the form. We want to link this entry date and time with ReminderInfo data type to set

    Reminders in activity Task Assign.

    Please find the ppt for more information.

    Please help us in this regard.

    Thank you

    Praveen

    Drag a SetValue component and add assignments (see the screenshot to the assignment)

    Repeat the same thing for hours and minutes

    Nith

  • How to convert the string in milliseconds

    Hello

    Please suggest how I can convert a string (October 9, 1989) in milliseconds...

    If it has a certain format, you can use HttpDateParser, otherwise create a calendar object, set the relevant values and get the time to it.

  • convert the data to array of bytes of screenshot?

    Hello

    I'm capture the screenshot of the screen of the device as bitmap data. Can I convert it to a byte array?

    Please help me through this.

    Thanks in advance

    in my knowledge base, I found a link to a similar question:
    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=736

    I did not try the search for forums - have you?

Maybe you are looking for

  • AirPlay icon not showing or missing

    Hello I use Macbook Pro 2016 OS X iPhong 6s iOS 9.3.4 and 10.11.6. I can't see the icon airplay on my devices. I have read a lot about this issue and tried to do but no change. Please advise me. Thank you. Nana

  • FCPX crashes when importing MXF

    Jin the images, I am trying to import comes from SONY PXW - X 70, who gave me the MXF files. These files can be read by VLC, no problem, there is something in there! but as soon as I start to import into fcpx, it crashes I tried to import a different

  • How to plot several points point (XY) on the same chart?

    Hello I have a table and a graph with a fixed axis x of Y values which varies. How to draw these new values y without replacing the previous ones? For example have a scatter of new data? Watch example Figure 1 below: Figure 1: (Note: the image was ph

  • Backgammon, checkers, Tic Tac Toe and Rummy tiles.

    I am looking for a FREE download of backgammon, checkers, Tic Tac Toe and Rummy tiles. Not trial versions. I search on google, but I'm not having any luck. I like to play on my computer, not online. Any suggestions?

  • Cisco Nexus 5596 does not start after NX-OS upgraded from 5.1.3.N1.1 to 6.0.2.N2.5 [CSCun66310]

    Hello friends, I want just to save your valuable time & effort, while Nexus 5596 upgrades so I wanted to share some useful information that you can have a quick glance before your Cisco Nexus 5596 device updates. Recently, I ran into trouble when upg