date diff issues - paging bill wilkinson

Results 1 to 2 of 2

Thread: date diff issues - paging bill wilkinson

  1. #1
    Join Date
    Dec 1969

    Default date diff issues - paging bill wilkinson

    this is a follow up of last night...<BR><BR><BR><BR>i&#039;m starting a new thread b/c i despise these types of forums. when a response is made, the thread should jump to the top :)<BR><BR>onto the problem...<BR><BR>i tried that, but i think you misunderstood what i was trying to do. i don&#039;t want it to say 2 days 13 hours 5 minutes & 24 seconds ago. i only want one time portion. if the post was made 34 seconds ago, i only want it to say "34 seconds ago". you&#039;re code was ripping the whole thing apart into the different time parts. i tried messing with if statements to write out what i wanted it to say, but since it was giving a response for each time part i couldnt get through the if statements correctly. if it can be done this way please explain.<BR><BR>otherwise... my code worked fine... on my computer. but when it&#039;s on the remote server it starts the seconds at somewhere in the -3000&#039;s a and counts backwards until it hits 1 min... then starts displaying properly.<BR><BR>so it works locally, but not remotely. why?

  2. #2
    Join Date
    Dec 1969

    Default Well, then...

    Don&#039;t display the upper parts if they are zero.<BR><BR>That&#039;s simple enough.<BR><BR>Get the <BR> secs<BR> mins<BR> hours<BR> days<BR>as I showed you and then:<BR> showing = false<BR> duration = ""<BR> If days &#062; 0 Then<BR> duration = days & " days, "<BR> showing = true<BR> End If<BR> If hours &#062; 0 OR showing Then<BR> duration = duration & hours & " hours, "<BR> showing = true<BR> End If<BR> If mins &#062; 0 OR showing Then<BR> duration = duration & mins & " minutes, "<BR> End If<BR> duration = duration & secs & " seconds."<BR><BR>???<BR><BR>*********************< BR><BR>Your original code made no sense to me at the time, but if that&#039;s what you wanted, go for it.<BR><BR>As for get negative number: Read the docs. It says that if you put the later datetime first, you will get a negative number.<BR><BR>Did you actually Response.Write the two datetime&#039;s you were taking the diff of?<BR><BR>But I can&#039;t figure out why you would want a display that would say something like<BR> 3735 seconds<BR> 62 minutes<BR> 1 hour<BR><BR>But if that&#039;s what you want...<BR><BR>I&#039;m out of here.<BR><BR>Next time, please tell what you *explicitly* want. Before you show the code.<BR><BR><BR><BR>

Posting Permissions

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