Bug with Date

While working on a project I've ran across a pretty nasty bug
with the Date class in flash. I've tested this in 8.0 Professional
and the issue also exists in 9.0 Alpha Release.
var d1:Date = new Date(2006, 12, 21);
var d2:Date = new Date(2007, 1, 31);
trace(Math.floor((d2.getTime() - d1.getTime()))/ 86400000);
This bit of code will trace 42 days which is correct.
Now try this:
var d1:Date = new Date(2006, 12, 21);
var d2:Date = new Date(2007, 2, 1);
trace(Math.floor((d2.getTime() - d1.getTime()))/ 86400000);
It traces out 39.
So how can a day one day later be 3 days less? Nice eh?
I further tested
var d1:Date = new Date(2006, 12, 21);
var d2:Date = new Date(2007, 12, 21);
trace(Math.floor((d2.getTime() - d1.getTime()))/ 86400000);
Which traces 365 and is correct. It appears there is some
time frame in Febuary, I haven't defined the range that has
problems.

12 is not a valid 2nd parameter in the date object in flash.
try 11 if you want to designate december.

Similar Messages

  • Bug with Data Entry Limits properties

    When setting programmatically the Data Entry Limit (e.g. maximum range) the value of the control is coerced (response is set to coerce). This is not supposed to be since Entry Limits are only for FP entry.
    Checked in 7.1 and 8.6
    Message Edited by JeanPierre on 05-12-2009 05:24 PM
    LabVIEW, C'est LabVIEW
    Attachments:
    20090512164802.png ‏6 KB

    I agree.  This seems like a bug.  I checked in 8.6.1f1 on my home PC and it does just what you say.
    I also tried to see if the problem occurred on the other end of the range in setting values greater than the Max and then resetting the minimum.  And it seemed to behave similiarly.  I can only save that back to 8.0  Here is that modification.
    I'm a little surprised no one has stumbled across this before if you say it's been around since at least 7.1  We'll see if an NI person takes a close look and agrees it's a bug and will submit a CAR# for it.
    Attachments:
    DataRangeMOD80.vi ‏25 KB

  • Bug with date parsing

    import java.util.*;
    import java.text.SimpleDateFormat;
    public class DateUtils3 {
    public static void main(String arg[]) {
         try{
         SimpleDateFormat sdf = null;
                             Date date = null;
                                  sdf = new SimpleDateFormat("yyyyMMddHHmmss");
                                  sdf.setLenient(Boolean.FALSE.booleanValue());
                                  date = sdf.parse("20100314021602");
                             System.out.println(date);
    }catch(Exception e){
         System.out.println(e);
    I get this error java.text.ParseException: Unparseable date: "20100314021602"
    But if you change the date to be 2009 or change it to march 13 or 15 or anything else , it works!!!

    sabre150 wrote:
    DrClap wrote:
    Yes, that's right. I didn't have a 2:16 in the morning on March 14 where I live either. The clock went straight from 2 AM to 3 AM and skipped all the times in between.Interesting. We (in the UK) usually change the clocks on the last weekend of March so the 14th would be far too early for us.Yeah, the Americans made us change a couple of years ago so they could save a ton of energy. Or so they said, I haven't seen the review which determines how much energy was actually saved. I prefer the theory that the change was made so that people would have 3 extra weeks per year to go golfing after work.

  • Re: iOS 4.2.1 bug with data entry

    I can no longer upload videos to the iPad. The videos show up as "format not supported" or alter pics in my apps.

    Hi and welcome to the forums!
    As you question is completely unrelated to the original post, it is both more polite to the original poster and more likely to get you the help you need if you start your own topic with a properly descriptive subject line.
    If you need help creating a new topic, see this link:
    http://discussions.apple.com/ann.jspa?annID=650
    Best of luck.

  • My email Box show blank messages with date 31/12/00.This bug passed my 3GS to 4S.How can i fix this?

    My email Box show blank messages with date 31/12/00.This bug passed my 3GS to 4S.How can i fix this?

    My email Box show blank messages with date 31/12/00.This bug passed my 3GS to 4S.How can i fix this?

  • Synchronize with Data Base' bug

    JDeveloper Version : JDeveloper 11.1.1.1.0 , ADF BC
    Use Case :
    - we have DB Table with filed named "Flage" and type "Number"
    - Create EO
    - Change "Flage" ' data type from "Number" to "varchar2" in DB
    - Use "Synchronize with Data Base" option for EO .
    The result for "Flage" attribute is :
    - Column Type : changed to "varchar2 " --- same as DB
    - Attribute Type : still have old type "Number"
    AND XML :
    Name="Flage"
    ColumnName="Flage"
    SQLType="VARCHAR"
    Type="oracle.jbo.domain.Number"
    ColumnType="VARCHAR2"
    TableName="Test"
    IsNotNull="true"
    Precision="200"
    Error will raise if you try to insert Character into "Flage" field
    and to fix problem we should change Attribute Type for EO to "Number" manually
    so , it is function of "Synchronize with Data Base " to change
    Column Type and not change Attribute Type ??? or there is some thing missing ??
    Thanx
    Wael No'man
    Edited by: Wael No'man on Aug 16, 2009 11:05 PM

    Hi,
    Currently Jdev supports synchronizing the database column type & not the attribute type.
    An Enhancement Request already exists for this.
    Regards,
    Shantala

  • BUG in data grid and run script (V1 1467)

    Hi,
    I found a weird bug in data grid when displaying data defined as NUMBER(10,0).
    We have a table with a column defined as NUMBER(10,0). Whenever this column contains data >5000000000 the data in the row shows up as null (empty cell) in the data grid.
    I played around a bit and found that running a scrip like select * from testtab where a > 5000000000; with F5 it stops at the first number >5000000000. Running the script with F9 shows all rows correct.
    I'm running on WIN2000 using SQL Developer V1 (Build 1467).
    The error was not present in Build 1422.

    I tried the SQL you supplied (by the way, the table name helps in the INSERT statement) and then went to the DATA tab to view the data.
    Interesting results.
    Even though all of the insert statements executed successfully, only 2 of the rows had any data displaying in columns A and C. All rows had data in column B.
    Now for the real fun: by selecting one of the empty cells the "missing" data would appear. Try a commit (yeah, I know nothing has been updated, but SQL Developer doesn't know this) and check out the UPDATE statements that are generated in the log. The cells I selected are being updated with the "missing" data. Refresh the display and the data goes into hiding again.
    I don't even want to get into the dangers of a tool updating data when all you've done is to get focus on a field. I've already seen it wipe out the time portion of date/time stamps simply because the default setting for the date/time format does not include the time.
    Good start on a tool guys, but it's not quite ready for Prime Time.
    BTW...I'm using Oracle 9.i running SQL Developer on Windows 2000.

  • SQL Developer with Data Modeler, No Design Menu Option

    Using SQL Developer 3.0.04 Build MAIN-04.34 with Data Modeler. I have created a logical design and wish to forward engineer this to a relational model.
    I cannot seem to find the Design Menu option to use the >> Engineer to Relational Model option which is available under the Design Menu on the Stand Alone version of SQL Developer Data Modeler.
    Have checked the following locations:
    Tools -> Data Modeler
    View -> Data Modeler
    File -> Data Modeler
    Right Click on my Logical Design
    I have ensure that all my entities have the Engineer To property set to a valid Relational Model.
    Is this a bug or am I missing a menu option / configuration setting?
    Thanks in advance for any help
    John

    Hi John,
    you can find ">> Engineer to Relational Mode" button among other buttons for logical diagram.
    Philip

  • Blocking bug with 10.8.3+Adobe Lightroom+Canon iPF5000 (but workaround found)

    Hi all,
    since I have updated my MacBook Pro (early 2011 model) with 10.8.3, I have a blocking bug with Adobe Lightroom (either 4.3 or 4.4) for launching prints on my Canon iPF5000 (firmware 1.33, either MacOS driver 2.67 or 3.06, connection through USB).
    When I was under 10.8.2 with the Canon's driver 3.06, everything works fine.
    Basically, after clicking Print a Copy or Print... in Lightroom, the file spooled to the driver stays in MacOS printer queue. Within the printer queue window, the printer is in pause mode, and each time I try to resume the printing processing, the driver put it on hold immediately. When I look into the history on the Console, the driver complains about an unknown error... The data stay within the driver, as my Canon iPF5000 "Data" led indicator stays unlit.
    My print settings are 600dpi or 300dpi, print sharpening Standard/Glossy, 16 bit output. And Color managed by printer (because I let the Canon driver managing my B&W prints).
    Strangely enough, when I launch a print from Preview application, the drivers does its job and sends it successfully to my Canon iPF5000...
    As this was driving me crazy, I have tried a clean install of MacOS 10.8.3 (as 10.8.2 is no more available from Apple servers...). No success, same blocking issue.
    Eventually, I've found the workaround: using the imagePROGRAF Advanced Preview. You have to click on "Print..." in Lightroom in order to see the driver settings window, and then check the "Preview before printing" option in the main tab of the driver settings. Then I can preview my Lightroom printing work and then launch successfully my printing.
    Simple workaround, but very strange bug...
    For me, the root cause could be multiple and not very obvious.
    Is it Mac OS 10.8.3 ? But why can I make prints from Preview application for instance, and not from LR ?
    Is it the Canon driver ? But this lead me to the same question.
    Is it Lightroom ? Does it send corrupted data that make the driver crazy but not the imagePROGRAF Advanced Preview ?
    So, if any user of Canon iPF5000 + Mac OS 10.8 + Lightroom is around, please share your experience.
    And if any Apple, Adobe or Canon engineer read this, please try to fix this.
    Happy printing,
    Amaury

    It's different how applications write print data. If you use Advanced Preview from the driver then it calculates already the output which afterwards is only sent to the printer.
    Have you once tried to print with fast graphic process switched off (option of advanced settings)?
    Hope it helps
    Renate

  • Labview freeze when accessing a custom menu with data on the clipboard

    This one has got me stumped:  When selecting a custom menu item with data on the clipboard the GUI freezes.  Freezes are longer for more data and longer for older versions of Labview.  I wrote the test code, attached, but the example "Menu Selection Demo.vi" shows the same behavior.
    Running Labview 2011 here are some freeze delays for my laptop (a bit slower machine) with various amounts of text data on the clipboard:
    Clipboard size        Delay
    1.3MB                   2.1 sec
    2.6MB                   4.9 sec
    3.8MB                   17.2 sec
    14MB                    253.3 sec
    The delay appears to be non-linear.  A doubling of the clipboard data size more than doubles the delay and a tripling of the clipboard data size produces a delay of almost 10X!  Things are also much, much worse on my ancient version 8.2.1 (over a 40 second freeze for 1.3MB and it goes up from there).
    Note that the freeze also occurs on programs with a custom menu when exiting.  This would seem to suggest it might have something to do with the timeout, but why timeout should vary with clipboard size and not with the value wired to it makes this feel even more like a bug in the custom menu functionality.
    This seems to be related to known issues in Labview 2011 #39604 49UBP4LE (http://www.ni.com/white-paper/13168/en#39604_by_Da​te) that was first reported in version 8.2.1.  This known issue relates to Labview freezing when large amounts of data are copied from Labview to the clipboard.  No fix has been implemented since this was originally reported in 2007.
    This freeze also occurs when shortcuts to menu items (such as Ctrl + L) are used when large amounts of data are on the clip board.
    Thus far this has been 100% repeatable and I have not been able to find a way around it.  I also haven't found anything else similar on the forums or on the web.  It appears to be a GUI freeze with Labview still running in the background, which is also odd.
    My work-arounds at this point are either to not use the clipboard (bad), programatically clear the clipboard several times each second (worse) or remove all custom menu functionality and replace those functions with onscreen controls.  So, for now, I'm removing custom menu items because my users need the clipboard and I can't have massive delays making my data acquisition code look crashed.
    Any ideas would be helpful.  This one has me scratching my head...
    Attachments:
    Menu_Clipboard_Lv2011.vi ‏17 KB

    Well, doing Microsoft Word, Excel and what else on a computer that is used to run an important production test, is a very bad idea. There is no way that you can guarantee, that one of these applications is not causing some interruption to the currently running time critical task. Word and Excel and just about any other computer application can crash, lock up the computer or eat your breakfast while you are doing seemingly harmless things.
    The issue with the clipboard in LabVIEW is indeed a problem that exists for a long time and I hope they fix it sometime, but the fact remains, that you should NEVER use a computer for other tasks while you run a test or other manufacturing related application on it, when a failure of that application can cost you more than a few pennies.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • 30EA1: Database mounted, can't get rows with DATEs

    I'm starting to use SQL Developer 3.0.02 build MAIN-02.37. I tried to use it with a 10g standby database that is only mounted, to check on its recovery progress, and it appears to NOT return rows with DATE columns in them. I've tried this with both a TNS connection and a basic connection. If the database is open, no problem.
    Example: select instance_name, host_name, startup_time from v$instance;
    If I remove the DATE column "startup_time" from the query, I get the expected rows. The Logging Page pane at the bottom shows ORA-01219 errors "database not open, queries allowed on fixed tables/views only."
    I get that ORA-01219 message in TOAD against the mounted standby database, but I also get all the rows including the DATE column when I run the exact same statement there.
    Is this a bug, or expected behaviour, or is there some setting I'm missing?
    Edited by: gmaccrim on Nov 25, 2010 4:26 PM

    I have similar problem on standby database with query on v$database.
    This query
    SELECT name,dbid FROM V$database
    works fine, but this one
    SELECT name,dbid,created FROM V$database
    doesn't return any row.
    I have Version 2.1.1.64 Build MAIN-64.45.

  • Optimization bug with C++ inlining

    Hi,
    While evaluating Sun Studio 11 I have identified an optimization bug with C++ inlining.
    The bug can easily be reproduced with the small program below. The program produces
    wrong results with -xO2, because an inline access function always returns the value 0.0
    instead of the value given on the commandline:
    djerba{ru}16 : CC -o polybug  polybug.cc
    djerba{ru}17 : ./polybug 1.0
    coeff(0): 1.000000
    djerba{ru}18 : CC -o polybug -xO2 polybug.cc
    djerba{ru}19 : ./polybug 1.0
    coeff(0): 0.000000            <<<<<<<<<< wrong, should be 1.000000This occurs only with optimization level O2; levels below or above O2 don't
    exhibit the bug.
    Compiler version is
    Sun C++ 5.8 Patch 121017-01 2005/12/11
    on Solaris 8 / Sparc.
    I include a preliminary analysis at the end.
    Best Regards
    Dieter R.
    -------------------- polybug.cc -------------------------
    // note: this may look strange, but this is a heavily stripped down
    // version of actual working application code...
    #include <stdio.h>
    #include <stdlib.h>
    class Poly {
      public:
        // constructor initializes number of valid coefficients to zero:
        Poly() { numvalid = 0; };
        ~Poly() {};
        // returns coefficient with index j, if valid. Otherwise returns 0.0:
        double coeff(int j) {
         if (j < numvalid) {
             return coefficients[j];
         } else {
             return 0.0;
       // copies contents of this Object to other Poly:
        void getPoly(Poly& q) { q = *this; };
        // data members:
        // valid coefficients: 0 ... (numvalid - 1)
        double coefficients[6];
        int numvalid;
    void troublefunc(Poly* pC) {
        // copies Poly-Object to local Poly, extracts coefficient
        // with index 0 and prints it. Should be the value given
        // on commandline.
        // Poly constructor, getPoly and coeff are all inline!
        if (pC) {
         Poly pol;                      
         pC->getPoly(pol);
         printf("coeff(0): %f\n",pol.coeff(0));
    int main(int argc,char* argv[]) {
        double d = atof(argv[1]);
        // creates Poly object and fills coefficient with index
        // 0 with the value given on commandline
        Poly* pC = new Poly;
        pC->coefficients[0] = d;
        pC->numvalid = 1;
        troublefunc(pC);   
        return 0;
    The disassembly fragment below shows that the access function coeff(0), instead
    of retrieving coefficient[0] simply returns the fixed value 0.0 (presumably because the
    optimizer "thinks" numvalid holds still the value 0 from the constructor and that therefore
    the comparison "if (i < numvalid)" can be omitted).
    Note: disassembly created from code compiled with -features=no%except for simplicity!
    00010e68 <___const_seg_900000102>:
            ...     holds the value 0.0
    00010e80 <__1cLtroublefunc6FpnEPoly__v_>:
       10e80:       90 90 00 08     orcc  %g0, %o0, %o0      if (pC) {   
       10e84:       02 40 00 14     be,pn   %icc, 10ed4
       10e88:       9c 03 bf 50     add  %sp, -176, %sp
                                                       local Poly object at %sp + 120
                                                             numvalid at %sp + 0xa8 (168)
       10e8c:       c0 23 a0 a8     clr  [ %sp + 0xa8 ]      Poly() { numvalid = 0; };
                                                             pC->getPoly(pol):
                                                             loop copies *pC to local Poly object
       10e90:       9a 03 a0 80     add  %sp, 0x80, %o5
       10e94:       96 10 20 30     mov  0x30, %o3
       10e98:       d8 5a 00 0b     ldx  [ %o0 + %o3 ], %o4
       10e9c:       96 a2 e0 08     subcc  %o3, 8, %o3
       10ea0:       16 4f ff fe     bge  %icc, 10e98
       10ea4:       d8 73 40 0b     stx  %o4, [ %o5 + %o3 ]
                                                             pol.coeff(0):
                                                             load double value 0.0 at
                                                             ___const_seg_900000102 in %f0
                                                             (and address of format string in %o0)
       10ea8:       1b 00 00 43     sethi  %hi(0x10c00), %o5
       10eac:       15 00 00 44     sethi  %hi(0x11000), %o2
       10eb0:       c1 1b 62 68     ldd  [ %o5 + 0x268 ], %f0
       10eb4:       90 02 a0 ac     add  %o2, 0xac, %o0
       10eb8:       82 10 00 0f     mov  %o7, %g1
                                                             store 0.0 in %f0 to stack and load it
                                                             from there to %o1/%o2
       10ebc:       c1 3b a0 60     std  %f0, [ %sp + 0x60 ]
       10ec0:       d2 03 a0 60     ld  [ %sp + 0x60 ], %o1
       10ec4:       d4 03 a0 64     ld  [ %sp + 0x64 ], %o2
       10ec8:       9c 03 a0 b0     add  %sp, 0xb0, %sp
                                                             call printf
       10ecc:       40 00 40 92     call  21114 <_PROCEDURE_LINKAGE_TABLE_+0x54>
       10ed0:       9e 10 00 01     mov  %g1, %o7
       10ed4:       81 c3 e0 08     retl
       10ed8:       9c 03 a0 b0     add  %sp, 0xb0, %sp
    Hmmm... This seems to stress this formatting tags thing to its limits...

    Thanks for confirming this.
    No, this happens neither in an Open Source package nor in an important product. This is an internal product, which is continuously developed with Sun Tools since 1992 (with incidents like this one being very rare).
    I am a bit concerned with this bug though, because it might indicate a weakness in the area of C++ inlining (after all, the compiler fails to correctly aggregate a sequence of three fairly simple inline functions, something which is quite common in our application). If, on the other hand, this is a singular failure caused by unique circumstances which we have hit by sheer (un)luck, it is always possible to work around this: explicitly defining a assignment operator instead of relying on the compiler-generated one is sufficient to make the bug go away.

  • GPS does not appear to work with data-roaming off and no wi-fi network

    I have been using an application called imarkmyspot to produce way-points for synchronising with my camera. When I am in my home country this works fine and a GPS location is found quickly.
    I've recently been abroad and had data-roaming turned off to avoid high expense. The point is that in this situation the GPS does not work (with imarkmyspot or Goggle Maps) unless I can access an open wi-fi network.
    So my question is, is this correct? Does GPS only work with either data access on or when within range of an open wi-fi network.
    If this is feature (bug) of the iPhone then this makes applications such as imarkmyspot rather useless when travelling. Alternatively it could be imarkmyspot that has this problem of course. But I'm quite sure Google Maps did not work either in this situation either.

    The iPhone's GPS does work without a data connection.
    Two weeks ago on a work-related trip I knew I'd be traveling a rural highway that would leave me without data/voice from any source for at least 45 minutes (no GSM service). Before leaving a city with data, I zoomed out using Google Maps far enough to show most of my route, then "nudged" the map so the application wouldn't try to get a data update for the map. I simply used the top power button to turn on and off the screen. The iPhone and GMaps tracked me through for the entire blacked-out section of my trip - I made sure the device had a decent view of the sky and it got a fix and nailed the location within a few seconds.
    Ironically, I'm returning that device in the next few hours for an exchange. The GPS hardware, it seems, has failed about a week ago - the device gets A-GPS fixes now (it shows the nearby 3G and EDGE towers), but won't lock in for more than a second or two. My iPhone's GPS worked, and now it doesn't - AppleCare told me my GPS hardware has failed - and you're may be exhibiting the same failure.
    Some A-GPS devices use their sources to get close by - like my TomTom GO and the ephemeris files it grabs from their servers to get updates on where satellite locations are - and then use the on-board chip to nail the device's position. From what I understand of the iPhone's assistance mechanism, the data tower's and Wi-Fi physical location needs to be correct and available in an accessible database somewhere - my iPhone was showing me near Houston TX (2200 mi/3500 km distant from my actual location) when using 3G data until the data source was updated.

  • [svn:osmf:] 13806: Fix a bug with the handling of drm metadata/ additional header

    Revision: 13806
    Revision: 13806
    Author:   [email protected]
    Date:     2010-01-27 10:00:06 -0800 (Wed, 27 Jan 2010)
    Log Message:
    Fix a bug with the handling of drm metadata/additional header
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/net/NetStreamPlayTrait.as

    (Removed)

  • [svn:osmf:] 10751: Fix a bug with the ReferenceSample project.

    Revision: 10751
    Author:   [email protected]
    Date:     2009-09-30 10:57:34 -0700 (Wed, 30 Sep 2009)
    Log Message:
    Fix a bug with the ReferenceSample project.
    Modified Paths:
        osmf/trunk/apps/samples/framework/ReferenceSample/org/openvideoplayer/model/ReferenceSWFE lement.as
        osmf/trunk/apps/samples/framework/ReferenceSample/org/openvideoplayer/view/MainWindow.as

    (Removed)

Maybe you are looking for

  • Error in Backup job scheduling in DB13

    Hi All Backup job scheduled in DB13 kicks error ,I am using Oracle as database and ERP6.0 database and application are on diffrent servers.Before it was working fine,I didn't changed any password I can run backupjob sucessfully directly from BRtools

  • How do I save all my e-mail folders on my own hard drive? (or keep copies)

    Firefox has been putting my older e-mails in TRASH without me asking; so I want to save all my incoming e-mail ON MY HARD DRIVE locally, as backup. Is this possible? IGNORE ALL THIS - it is YAHOO!Mail I need to deal with. My Mistake - SORRY !

  • Inter company or Cross company reconciliation

    Hi all, I have setup intercompany clearing accounts between 2 comp. codes in OBYA. I posted transactions and seems to work fine with correct balances in the 2 clearing accounts. Now, at closing, how do I clear these accounts? The old t.code f.2e does

  • OIM 11g server start up error

    Hi All, I am seeing below error when I start OIM server, any help ? <Jun 13, 2011 1:20:24 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> <Jun 13, 2011 1:20:24 PM EDT> <Notice> <WebLogicServer> <BEA-000360> <Server st

  • Is it possible to copy multiple classes into one class?

    Hi there, My environment is 2007 R2. We have two class: Class1 and Class2. Both are populated by a script discovery. Now I want to create another class: Class3 which should contain the object of BOTH Class1 and Class2. Of cause I can create another s