Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 04-04-2014, 03:40 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,595
IntoRain is on a distinguished road
Default

In the canWork() function, instead of working with the last time user worked, you'd compare today's date to the date you wanted.

PHP Code:
//get today's date, format returns the date in the specified format. m means month and d is day. So 'm-d' means 'month-day' format

$dateToday = new DateTime;
$dateTime $dateToday->format('m');//get the month only for example

//compare with the month we want
if($dateTime != '04')
{
//it's not april yet, can't work
}
else{
//it's april, can work
}

//or for month-day
$dateToday = new DateTime;
$dateTime $dateToday->format('m-d');//get the month only for example

//compare with the month we want
if($dateTime != '04-15')
{
//it's not april 15 yet, can't work
}
else{
//it's april 15, can work

__________________


asp.net stole my soul.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Javascript Games to Give Users Currency Hwona Questions and Supports 2 12-13-2015 05:01 AM
How to earn money on site? O.o Rovick Questions and Supports 2 06-29-2014 03:31 AM
Page that gives users money Derpstra Tutorials and Tips 0 08-18-2012 11:34 AM
Change earn money jcga1992 Questions and Supports 1 04-24-2012 10:39 AM
Earn Random Amounts of Money Rissan Suggestions and Feature Requests 2 08-25-2011 09:51 PM


All times are GMT -5. The time now is 04:47 PM.

Currently Active Users: 3699 (0 members and 3699 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636