Looks like a bug in Date class

Hi guys,
I just logged in to highlight what I encountered when I was
trying to convert milliseconds of a time stamp to a date/time
string.
Just see the following codes.
public function
convertTimeStampToDateAndTime(timeStampInMilliseconds:Number):String
var stampReadableFormate:String = null;
if(!isNaN(timeStampInMilliseconds))
var stampDate:Date = new Date(timeStampInMilliseconds);
var stampHour:Number = stampDate.getHours();
var stampMin:Number = stampDate.getMinutes();
var stampSec:Number = stampDate.getSeconds();
var stampYear:Number = stampDate.getFullYear();
var stampMonth:Number = stampDate.getMonth() + 1;
var stampDate:Number = stampDate.getDate();
stampReadableFormate = "" + stampDate + "/" + stampMonth +
"/" + stampYear + " " + stampHour + ":" + stampMin + ":" +
stampSec;
trace("Date/Time=" + stampReadableFormate);
return stampReadableFormate;
Then I call this method from somewhere by using,
var reportTime:String =
this.convertTimeStampToDateAndTime(new Date().getTime());
You can see trace method in convertTimeStampToDateAndTime()
is giving you a correct output.
But just change the convertTimeStampToDateAndTime() method in
a way that you get time information after you got date, month and
Year. To explain what I am taking about I have pasted changed code
as following.
public function
convertTimeStampToDateAndTime(timeStampInMilliseconds:Number):String
var stampReadableFormate:String = null;
if(!isNaN(timeStampInMilliseconds))
var stampDate:Date = new Date(timeStampInMilliseconds);
var stampYear:Number = stampDate.getFullYear();
var stampMonth:Number = stampDate.getMonth() + 1;
var stampDate:Number = stampDate.getDate();
var stampHour:Number = stampDate.getHours();
var stampMin:Number = stampDate.getMinutes();
var stampSec:Number = stampDate.getSeconds();
stampReadableFormate = "" + stampDate + "/" + stampMonth +
"/" + stampYear + " " + stampHour + ":" + stampMin + ":" +
stampSec;
trace("Date/Time=" + stampReadableFormate);
return stampReadableFormate;
now call
var reportTime:String =
this.convertTimeStampToDateAndTime(new Date().getTime());
Now see the trace out put, what has happened, your timing
informations are undefined.
Looks like it is a bug to me.
If this issue has already been discussed before I am very
sorry by duplicating it.
Chears
Naleen

Thanks for all the responses.
I am not redefining stampDate inside your function/method.
Please look at it again.
I call convertTimeStampToDateAndTime() from out side and in
my original post I have written it as following....
var reportTime:String =
this.convertTimeStampToDateAndTime(new Date().getTime());
That is just an example for you to udnerstand it,
But what we are doing in our actual application is we read an
XML file which has time stamps on each elements as attributes. For
an example, if following is the XML line....
<element timeStamp='1195770453174'
>blaaa</element>
In Actionscript we call this method,
var reportTime:String =
this.convertTimeStampToDateAndTime(1195770453174);
So I am not redefining at all.
Just do a simple test by user self.
My second point is.... If I am redefining a date again with
same number of Milliseconds Date class constructor shouldn't care
it.
For an instance
Var myMilliSEC1:Number = new Date().getTime(); // this is
constructing today's date and converts to milliseconds
var myDate1:Date = new Date(myMilliSEC1); //so this should
give me the todays date again...
Var myMilliSEC2:Number = myDate1.getTime();
Now myMilliSEC1 should equal to myMilliSEC2
But that is a different issue.... I am just answering for
your comment on "REDEFINING DATE":
Anyway thanks for your time and concern.

Similar Messages

  • Occasional invalid modified date on a file - looks like a bug

    In the Bridge script I'm working on, I need to compare the last modified dates of files. I've found that when I iterate through the app.document.visibleThumbnails array that in nearly every directory I test on, there are one or two files that return an "undefined" value for app.document.visibleThumbnail[i].spec.modified. It is not the same two files each run, but it's always at least one that has a missing value. It's a pretty simple test app to illustrate the problem:
    var thumbs = app.document.visibleThumbnails;
    for (var j in thumbs)
    var modDateSpec = thumbs[j].spec.modified;
    if (modDateSpec == undefined)
    Window.alert("modification date is undefined");
    Unless this value is not intended to be reliable, this appears to be a bug which is why I am reporting it. I have worked around the problem for now by getting the fsName from the same thumbnail, creating a new File object with that fsName and getting the modified date from that temp object.
    I've verified that purging and rebuilding the cache does not make the problem go away. I see this problem on many different directories.
    Is this the right place to report this type of bug or is there a different procedure I should follow?
    --John

    pessex wrote: Anybody know?  Or know of a different way that I COULD do it in Terminal?
    Don't know about Terminal, but, because you are using 10.9.x and iMovie, try the iMovie method:

  • HT4623 Looks like a Bug in the Default Mail application of iOS 6 in an iPhone 4S

    In the mail application of my iPhone 4S running iOS6, while composing a new email, the recipients field marked as "To: " doesn't respond in a single tap rather requires two or three and sometimes even more taps for the blue input bar to appear and enable typing of the recipient's email address.
    I have tried resetting the iPhone completely to factory settings and erasing everything several times, but the problem still persists.
    It has nothing to do with the suggested automatic recipient addresses as the field doesn't gets activated itself in first tap and the blue bar doesn't appear unlike all other fields such as, "Subject", Cc, etc. It looks as if the touch screen didn't get any feedback and hence returned no response.
    Once after a few tapping trials, the blue input bar appears indicating the field ready for the recipient's address to be typed and then everything gets normal from there.
    Rest all the applications and everything on the iPhone is working perfectly fine with no problems anywhere at all.
    Kindly suggest the necessary measures.
    Also, I am facing exactly the similar situation with my iPod Touch 4th generation running on iOS 6 as well. This has made me conclude that it must be a bug in the mailing application.
    Both the devices are only a month old. Also they are configured for different account s and have completely different dat from one another as the ipod touch is being used by my sister who has a separate masbook to sync it.

    That connection is supported for tethering....
    Barry

  • Looks like a bug in Java ... what's going on he

    I can't really recreate this problem, but it occurs in situations like the one below. Unfortunately the program is just too complex to post it all here. In other words, I'm not sure if this exact code will produce the bug, but it happens sometimes in similar situations:
            System.out.println("arrived here");
            // while not ready
            System.out.print("waiting until initialisation is ready..."+AnimationFrameManager.printCurrentFrame()+" ... ");
            // System.out.println("THIS LINE HAS BEEN PRINTED");
           while (!this.isReady)
                // do nothing
            System.out.println("done!");The bug is that I get output like this:-
    arrived here
    waiting until initialisation is ready...3...waiting until initialisation is ready...3...done!Why is it printing twice?
    Weirder still is that if I put a line in-between the last println statement and the beginning of the while loop (for example, the line that is commented out above), then it works as expected!
    i.e.
    arrived here
    THIS LINE HAS BEEN PRINTED
    waiting until initialisation is ready...3...done!If I take the static method call out, it works as expected:
            System.out.println("arrived here");
            // while not ready
            System.out.print("waiting until initialisation is ready... "); // <!-- took the static method call out
            // System.out.println("THIS LINE HAS BEEN PRINTED");
           while (!this.isReady)
                // do nothing
            System.out.println("done!");Any ideas?
    Edited by: GallahJava on Feb 2, 2010 7:47 PM
    Edited by: GallahJava on Feb 2, 2010 7:52 PM

    There is no GUI, just console output.
    I realise there is multi-threading going on "behind the scenes", but I haven't explicitly created any threads except for one; this is the one-and-only thread created by me, does this help? I can't imagine how it could possibly be responsible for these "multithreading issues".
    public class AnimationRunner implements Runnable
        private SuperImage[] images;
        private int imageNo;
        private static final int MAX_IMAGES = 39; // How many images in the progression?
        private static final int SWAP_DELAY = 850;
        public AnimationRunner()
                images = new SuperImage[MAX_IMAGES];
                System.out.print("\nInitialising images to memory...");
                for (int x = 0; x < MAX_IMAGES; x++)
                    String imageFile = "images/anim-frame-" + (x + 1) + ".png";
                    //System.out.println(imageFile);
                    images[x] = SuperImage.createFrom(imageFile);
                System.out.println("done!");
                imageNo = 0;
                new Thread(this).start();
        public void run()
            System.out.println("Animation has started.");
            while (true)
                try
                    Thread.sleep(SWAP_DELAY);
                    if (imageNo >= MAX_IMAGES - 1)
                        imageNo = 1;
                    else
                        imageNo++;
                    //System.out.println("Now on image #" + (imageNo + 1) + "\n");
                catch (Exception e)
        public int getImageNo()
            return imageNo + 1;
        public SuperImage getImage()
            //System.out.println("\n(using image no."+(imageNo+1)+")\n");
            return images[imageNo];
    }

  • Acrobat  CD Form Button Display incorrectly  when an effect  or transparency  is applied  Via indesign  Looks like a bug

    I have tested existing interactive pdfs that function perfectly in Acrobat XI and Adobe acrobat Reader but open the same files in Acrobat DC and Acrobat DC Reader and most of the documents i have designed and produces over last few years have been renderer useless
    Basically any interactive  form field wich uses  Effects,  Transparency  or  mode changes  like multiply  in every instance the  whole form element appear as a pixelated mess
    I have been posting  in an indesign Thread  https://forums.adobe.com/message/7427566#7427566  it contains  picture and a sample document
    Steve Werner has been helping  me   and has suggest  i post here too
    Graeme,
    I downloaded your PDF file. I have both Acrobat DC and Acrobat XI Pro and I can confirm that I view it the same way that you do.
    It clearly seems to be a bug. In the Acrobat beta group, most users are probably not InDesign users, and most of us who do use InDesign probably didn't create or test Show/Hide buttons using those forms of transparency. I'm sure it's not intentional, probably a side effect of some other change.
    It needs to be reported as a bug. I'd suggest using the Bug Report form here:
    Adobe - Feature Request/Bug Report Form
    Also, there are several Acrobat forums. I'd suggest posting (if you haven't already) in the these two forums:
    Rich Media & 3D
    PDF Forms

    It's good that you'll be submitting a bug. This sort of thing has happened before, and I think it's related some to the fact that InDesign is capable of generating field appearances that you can't set up in Acrobat (transparency in particular).

  • What would the best process chain look like for this MD data load scenario?

    Hi there,
    I have the following setup. SAP BW connection to external system via DBConnect (DB2 database).
    We have 73 master data text data sources to load either once a week or everyday through process chain. We have not decided on the exact schedule yet.
    All the master data text DataSources pull data from the SAME VIEW created on the DB2 external system:
    VWDEDMASTERDATA
    The structure of the view is the following:
    DEDNAME
    DEDNAMETYPE
    DEDNAMECODE
    DEDNAMEDESC
    DEDNAMELONGDESC
    So, everytime master data text is extracted for all the 73 objects it queries the same view over and over again VWDEDMASTERDATA. We only differentiate in the datasource on the FIELDS tab which InfoObject should DEDNAME map to and then in InfoPackage we filter on the exact object/field to query.
    So essentially, every time we run InfoPackage for master data text object the external system gets queried in the following way:
    SELECT * from VWDEDMASTERDATA where DEDNAME = [FIELD/InfoObject specified in InfoPackage]
    So, if I have to have all 73 objects loaded, essentially the same SQL statement has to execute 73 times. In this scenario, what would be the proper process chain setup that has perfomance in mind? How should the InfoPackages be arranged, in parallel, sequentially, how many in a row, etc?
    Let me know if you need more information.
    thanks

    They would like to send the letters to me
    Depending upon how they send the letters to you and how they expect Acrobat to convert them you could be bordering on a license violation that prohibits you from using your version of Acrobat as a server-based product.
    Adobe offers server based products to convert rtf files into pdf files. Some require your company to run a server, but one seams exactly what they may want. The createpdf service is run by Adobe and seems capable of doing what your company wants.
    https://www.acrobat.com/createpdf/en/home.html

  • Looks like a bug in DB, Getting a invalid number with a group by

    Hi All,
    This is very strange problem that I am encountering. Would like to hear from you, if you have also witnessed something similar:
    What I am doing:
    basically I am doing something like:
    Select x,y,z,count(distinct a) from
    taba,tabb,(select col1,col2 from tabc) tc,
    tabd left outer join tabe on tabd.col=tabe.col,
    viewf
    where (joins between the tabs)
    group by x,y,z
    All the join columns are number(10,0) in all the tables/views.
    If I run this query I get an invalid number 01722. If I comment the count(distinct a) column, the query runs fine.
    Or if I put the to_number for all the joined columns in the where clause, the query runs fine.
    I have never seen such behaviour of Oracle database. May be I am doing something really wrong?
    Looking for help.
    Thanks in advance.

    Well, I do not think it is related to GROUP BY or to DISTINCT. Most likely you have some column X that holds both numeric and non-numeric strings and some other column that indicates if column X value is numeric. If this is the case, you can get ORA-01722 simply becuase Oracle does not apply where clause predicates in the order they are listed. Assume column c1 holds numeric strings when column c2 is set to some specific value. Even if you use:
    WHERE c2 = 'some-value'
    AND TO_NUMBER(c1) = 5
    it is not guaranteed Oracle will first check c2 and only then c1. And if Oracle decides to check c1 first, TO_NUMBER will fail on the first non-numeric c1. Especially it can happen in not very recent Oracle versions. In recent versions most of the time optimizer is smart enough to realize that checking c2 costs less that converting c1 to number and then checking it, so it will check c2 first. Anyway, you need to use ORDERED_PREDICATES hint to let optimizer know to follow predicate sequence. For example, in 9i:
    SQL> create table tbx(flag varchar2(6),value varchar2(10))
      2  /
    Table created.
    SQL> insert into tbx values('alpha','abc');
    1 row created.
    SQL> insert into tbx values('number','123');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from tbx
      2  where flag = 'number' and value = 123
      3  /
    where flag = 'number' and value = 123
    ERROR at line 2:
    ORA-01722: invalid number
    SQL> select /*+ ORDERED_PREDICATES */ * from tbx
      2  where flag = 'number' and value = 123
      3  /
    FLAG   VALUE
    number 123
    SQL>SY.

  • Extra bars in score set -- looks like a bug

    I've been working on some tunes and wanted to display both the bass track and the track with lyrics. Logic Pro 8 seems to have some trouble with this. A bug seems to add additional portions of a bar. Check out this screen shot and note the extra bar 21. If I look at individual tracks, it is fine. If I change windows and go back, it seems to refresh the screen correctly. This problem creates a big problem when I'm trying to play along.
    Screen shot:
    http://www.punkjob.com/ScoreSet.jpg

    you'd be far better off displaying this in a seperate editor the 'old' way, if you ask me. incidentally is this a LP7 song or freshly minted in 8?
    nice bug BTW.

  • Looks like a bug in RoboHelpX6 - CSS

    I have been working in RoboHelpX6 on some CSS - Initially I
    updated an existing CSS, and changed the font that was being used.
    Was using Tahoma and changed it to Verdana, when I did this the CSS
    lost the word wrap. I then went and created a new CSS from scratch,
    stated it out with Tahoma like the first one, everything worked
    fine. Went in and changed the font to Verdana and again lost the
    word wrapping!!!
    Any reports on this yet?

    RoboHelp x5 rewrote CSS as well. I'm pretty sure they think
    it's a feature.
    The workaround I developed involves authoring/editing the
    .css files outside RH, keeping them under version control, and
    reverting them whenever RH tries to change them, plus copying clean
    .css files over the rewritten ones after projects have been
    generated.
    Note that for every stylesheet fname.css you have, RH will
    create a supposed "Netscape" version of the stylesheet called
    fname_ns.css. Again, I'm pretty sure they think this is a feature.
    Unless you like the way the _ns.css version looks on
    Netscape/Firefox/whatever, you will want to copy your clean
    fname.css over fname_ns.css as well.
    Amy

  • [SOLVED] Cannot boot (doesn't look like i915 bug)

    I can't boot my laptop.  Immediately after pressing enter in grub, I see black.  I put my laptop to sleep when it had about 10% battery remaining, and I'm guessing that it ran out of juice before I plugged it in.
    My last successful boot was just after installing linux 3.16.3-1 on September 21.  I booted with archboot and did a chroot.  The only "suspicious" packages I upgraded after this boot were xorg-server+common+xephyr and xf86-video-intel.  So I downgraded these.  No improvement.
    I read about the i915 kernel bug and couldn't find any lines mentioning i915_gem_stolen.c in journalctl -r.  But I downgraded my kernel to the kernel I had been using for a while, 3.15.5-2.  After this, I was happy to see the normal boot messages appearing.  However, when the console login appears, I can't input my user name.  Rather it disappears and reappears every second.  And, interestingly, it writes "Arch Linux 3.16.3-1-ARCH (tty1)" there instead of the kernel version I just downgraded to.
    The same behavior (disappearing and reappearing console login) happens when booting in recovery mode.
    Which logs do I need to look at in order to figure out what is going on?
    Thank you!
    Last edited by tinte (2014-09-27 15:41:01)

    Try rebooting with iso & doing the chroot thing then try to install the lts kernel & its headers/modules & then check everything.log etc for further clues & reboot after.
    The i915 bug has been a weird one with a whole host of different effects for everyone but as you are getting odd behaviour after a kernel downgrade I really would suggest the lts route just to see if that will give you a working system.
    good luck

  • Firefox 5 is not able to download and open PDF files as Firefox 3.6 was able to. This looks like a bug to me. When will it be fixed?

    There are many web sites that I visit to download statements that are in PDF format. In Firefox 3.6, when I selected a statement to download, Firefox opened a new window that indicated that the PDF is being downloaded. When the download is complete Firefox either opens the document or the document is opened outside of Firefox by Adobe Reader. In both Firefox 4 and 5, the PDF file download never occurs. This functionality has always worked in Internet Explorer and Google Chrome. I currently use Adobe Reader X 10.1.0. I tried going back to Adobe Reader 9.4.5, but this did not make a difference. So I think the problem is in Firefox.

    it is not your ISP BT Retail that owns/repairs the lines it is openreach which although part of the BT Group has no more direct contact then any other ISP
    you can check your exchange here  http://usertools.plus.net/exchanges/mso.php
    http://usertools.plus.net/exchanges/?
    http://btbusiness.custhelp.com/app/service_status
    http://bt.custhelp.com/app/answers/detail/a_id/15036
    http://community.plus.net/exchange-information/
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Looks like a bug...

    Hello,
    We're using JHS 9045 with Oracle MVC and UIX.
    The following sequence of actions causes unusual (and perhaps invalid) JHS behavior:
    ===========================
    1. Some existing AbcDataObject is displayed in abc.uix page(in update mode). Page has "aaa" in field 1.
    2. Change is made in field 1: "aaa"->"bbb" (this change introduces some logical error)
    3. Page is submitted (user clicks "save" button)
    4. Logical error is caught in persistence layer, UserException is thrown
    5. Page abc.uix is displayed with an error message. Page has "bbb" in field 1.
    6. Change is made in field 1: "bbb"->"ccc" (to fix logical error)
    7. Page is submitted again (user clicks "save" button)
    8. BUG? - Page comes back with "No changes to save" message. Page has "aaa" (original value) in field 1.
    Expected behavior is the successful save of "ccc" value.
    ====================
    The service file has a very standart process chain for "save" action:
    -> SaveDataObject -> Forward
    ====================
    As far as I could see DataObjectHelper.addNewAttributes() call is not returning "ccc" as a new attribute value.
    ====================
    Could you please let me know whether it is indeed a bug or I am just missing something?
    Thanks in advance,
    Igor Gorbunov

    Igor,
    Yes, well spotted, this is a bug.
    I have fixed it right away, the fix will be shipped with the next maintance release, that is scheduled for end of march/beginning of april (depending on jdev10g, because we want to make this release compatible with JDev 10g production).
    Steven Davelaar,
    JHeadstart team.

  • HT4943 Guys I am not able to read several magazine subscriptions on the ipad (newsstand) It looks like a bug, cause it keeps showing the below box: Connect to itunes to use push notification...when,  i press ok, it keeps showing up help please!!

    Guys I am not able to read my subscription on the ipad. Everytime i press one of the subscription a box appears and when I press oK it keeps showing up.
    "connect to itune store to use push notification"
    Thanks for your help

    You welcome

  • AA3 can't read BWF from Reaper -Looks like a bug to me

    wav files made in Reaper (ver 3.11) can have the bext BWF timestamp.
    These files read just fine in AA (v1.5, ), Sound devices Wave Agent, Widget Pro, SSL ProConvert, Nuendo, Samplitude & Reaper itself. AA3 sees them as being BWF files & there is some impenetrable code in the UMID but otherwise all bext metadata gone.
    If I open a file in AA 1.5 & save, AA3 can read the bext info.

    BTW forgot to mention. If the Reaper files are imported straight into the MT page (AA3) using timestamp position they get positioned as per bext timecode. But as I say no metadata to be seen in EV. And if I save the files (save extra info ON) the bext metadata gets trashed.
    John L

  • Looks like a bug in SAP code - Please let me know if you have faced it

    Hi All,
    My requirement - to protect a range in excel sheet and download the excel to PC
    but this particular method provided by SAP does not work
    CALL METHOD spreadsheet->protect_range
           EXPORTING name      = name
                     protect   = protect
                     no_flush  = no_flush
           IMPORTING error     = error
                     retcode   = retcode.
    The full sheet protection method does work. Please let me know incase you have come across this issue.

    JUST FOUND THIS ON NEWEGG!
    Rating: 1/5Major problems, but HP added free warranty support to fix
    This review is from: HP Pavilion Elite HPE-400F (BT470AA#ABA) Desktop PC Phenom II X4 945 (3.0GHz) 8GB DDR3 1TB HDD Windows 7 Home Premium 64-bit
    Pros: HP is offering a North America Limited Warranty Service Enhancement which extends the warranty on these because of numerous reported issues! Free motherboard replacement.
    http://h10025.www1.hp.com/ewfrf/wc/document?docnam​e=c03199423&cc=us&dlc=en&lc=en&product=4300938
    Cons: Numerous users report blue screening, random reboots, or no boot without beeps!
    BUT I HAD TO STUMBLE ON TO THIS, AFTER MINE QUIT!
    NOW THEY SAY, SORRY, ALL OUT OF THEM, AND YOUR OUT OF WARRANTY,  AND S * * * OUT OF LUCK & $800.00!!!!!!!!!!!!!

Maybe you are looking for

  • Can you operate an iPod Shuffle and an iPod Mini on same PC

    The problem I am experiencing is that an iPod Shuffle was operating correctly with iTunes. I then wanted to register a new iPod Mini on the same PC. I then experienced conflicting error messages - can this problem be resolved please. In short, can yo

  • Printer won't print more than one copy

    Ever since I got my new computer, I have not been able to print more than 1 document at a time from Microsoft Works.  When I need to print over 500 hundred copies every few months, this is a big problem for me.  Any other programs will print as many

  • Need Help Fast! Page is dispalying twice in quiz

    I have created a quiz using tips from another post in this forum. I insterted a regular slide with a continue button before the quiz questions. I insterted another regular slide at the end of the questions with a re-take button that points to that fi

  • Drag and drop in parallels 6

    I installed trial Parallel 6. I can only drag and drop from windows desk top to mac desktop, iMac. I can nod do the same dragging from Mac to windows XP. I have the + sign but nothing happens. I reinstalled the tools. No change. Is there a solution?

  • If you think Elastic Audio is cool....

    let me introduce you to something called good musicians. Sure they can be buggy at times. I mean I've had my share of musician crashes though usually after a few too many six packs, but 9 times out of 10 its pilot error. But these good musicians are