SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    compairing dates like 08/29/2007 to 08/30/2007

    is there a way to compare dates/times using javascript that are already coded to output like this: 08/29/2007 8:30 to 08/30/2007 10:00

    Var CurrentDateTime output: "MM/DD/YYYY HH:MM"

    I am trying to find a way to calculate if the deadline for a project has passed, and have been stuck on the if statement, since you cant really compare variables that have slashes, spaces, and colons in them... or can you?

    Any help would be appreciated.
    thx

  2. #2
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    new question

    I guess my original question was if you could do math with a variable that output like this "08/29/2007 9:30" I am going to go back to that. Is there a way, if I have no control over how the variable is populated if I can edit its contents.

    such as:
    If I have a variable named currentDateTime and its output is "MM/DD/YYYY HH:MM" is there a way to separate out its values like this: "MM" = currentMonth "DD" = currentDay "YYYY" = currentYear "HH" = currentHour "MM" = currentMinute.

    The reason I dont have control over the currentDateTime script is because its a built in function, that calls for the server time.


Bookmarks

Posting Permissions

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