Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Values of 8 and 9 are converting to 0?

    I am working with comparing dates. The problem I am having is that August (08) comes AFTER July (07). However, it seemed to consider Aug (08) and Sep (09) to be earlier than Jan-Jul. When I took a look at the values, they were shown as...

    July = "07"
    August = "00"
    September = "00"

    Anyone know why this might happen? Is there a possible fix?

    Any help is greatly appreciated. Thanks.


    SnotRockit

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    You should do a search for this very question. It has been answered twice in the recent past. One of those answers was last week.

    The reason is because numbers prefaced with 0 are octal, and 08 and 09 are not valid octal values, so it chokes. You can fix this by doing Number('08') or whatever your variable is that stores '08' and you will get 8 back.

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    SnotRockit: The answer to this question is in the FAQ.

    If you want a more thorough explanation, see this textual explanation or this tabular breakdown.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •