month,day,year output is wrong

Results 1 to 3 of 3

Thread: month,day,year output is wrong

  1. #1
    Joshua Mann Guest

    Default month,day,year output is wrong

    I am generating a orderId for my companys website, the order id should contain month,day,year,hour,min,sec, and 4 random numbers.<BR>the problem is that on both my personal machine running PWS and the 2 servers running IIS the script keeps spitting out the same day no matter what the real date is. Below is my code.<BR>&#060;%<BR>&#039Generate order ID<BR>intThisDay = Day(datToday)<BR>intThisMonth = Month(datToday)<BR>intThisYear = Year(datToday)<BR>intHour = Hour(now)<BR>intMin = Minute(now)<BR>intSec = Second(now)<BR>intTime = (intHour & intMin & intSec)<BR>randomize<BR>intOrder = Int(rnd * 9999)<BR>OrderID = (intThisMonth & intThisDay & intThisYear & intTime & intOrder)<BR>%&#062;<BR>This is the output:<BR>123018991045367187<BR>(12/30/1899 10:45:36 7187)<BR>do you notice that it tells me its Dec. 30th 1899.<BR>What can i do to fix this? is my code wrong?<BR><BR>Thank you,<BR>Joshua Mann

  2. #2
    Join Date
    Dec 1969

    Default RE: month,day,year output is wrong

    intThisDay = Day(datToday)<BR>intThisMonth = Month(datToday)<BR>intThisYear = Year(datToday)<BR><BR>The date is pulling from the variable datToday (which is is either undefined (resulting in 12/31/1899).. or set to 12/31/1899. Try changing the code to...<BR><BR>intThisDay = Day(Now())<BR>intThisMonth = Month(Now())<BR>intThisYear = Year(Now())<BR><BR>Hope this helps... Cheers!

  3. #3
    Joshua Mann Guest

    Default RE: month,day,year output is wrong

    ;^)<BR> worked.<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