NEED HELP...cookies and date commands

Results 1 to 2 of 2

Thread: NEED HELP...cookies and date commands

  1. #1
    Join Date
    Dec 1969
    Posts
    52

    Default NEED HELP...cookies and date commands

    I need to know how to make a cookie expire on the last day of the month..it&#039s for an image top 10...I want people to have a limited number of votes per month...so I need to know how to make the cookie that&#039s made expire at the end of each month....next I need to know how in the world I can determine last month..I have the command to get this month -- MonthName(Month(Date)) -- but I want to know how to get last month in text form...(which would be June as of today)...Thanks ahead of time...Roy mailto:rdraper@tla.com

  2. #2
    John Harvey Guest

    Default Date Commands and Cookies

    Here&#039s how to get the last day in the month<BR><BR>MM = Month(Now)<BR>If MM = 2 Then<BR> If Year(Now) mod 4 = 0 Then &#039This works until 2100...<BR> LastDay = 29<BR> Else<BR> LastDay = 28<BR> End If<BR>ElseIf MM = 4 OR MM = 6 OR MM = 9 OR MM = 11 Then<BR> LastDay = 30<BR>Else<BR> LastDay = 31<BR>End If<BR><BR>Response.Cookies(CookieName).Expires = MonthName(MM) & " " & LastDay & ", " & Year(Now)<BR><BR>Here&#039s how to get the last month.<BR><BR>LastMonth = MonthDate - 1<BR>If LastMonth &#060; 1 Then<BR> LastMonth = 12<BR>End If<BR>MonthName(LastMonth) <BR><BR>Regards,<BR>John Harvey

Posting Permissions

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