Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How can i calculate with a date

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
kyodai Posted - 20 December 2009 : 08:59:04
Hi there,

i want to add a "mute" function so my mods can "mute" a user for like 24 hours and he can not post in that time period. I think that's much better than directly banning a spammer, because i feel some people CAN learn.

So i wanna give my mods a "mute" button, but how can i calculate with dates?


I have added custom fields to the MEMBERS table, so every user has additional colums "Muted" (boolean, standard 0), "MutedUntill" (I thought date, but i have seen snitz uses nvarchar(14)...), "MutedBy" (mod username, probably nvarchar(150)), MutedReason (Nvarchar).

I think i get most stuff done, but i don't understand how to calculate with the dates. How can i make it so it writes "Current date + 24 hours" to the MutedUntill field? And how can i check against that, like if currentdate > muteddate then (allow posting)?
1   L A T E S T    R E P L I E S    (Newest First)
ruirib Posted - 20 December 2009 : 13:03:44
You will need to use the function StrToDate to convert from the snitz format and then use VbScript date functions to add a day and convert back to Snitz format with DateToStr, which is another function also available in our code.

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000 Version 3.4.07