Check date in php
#1
Posted 10 December 2005 - 07:15 PM
how would I use php to check a date in the format yyyy-mm-dd to see if it has been a week since that date.
thanks,
Ben
#2
Posted 10 December 2005 - 08:57 PM
echo date("Y-m-d",(time() + 60*60*24*30));
which displays today date + 30 days and I am using if else statements to see if todays date matches 30 days on from the date in the database.
#3
Posted 11 December 2005 - 02:10 AM
#4
Posted 11 December 2005 - 03:03 AM
<?php
$time = time() - (60*60*8); //Take away 8 hours from the time the server is set to (GMT)
echo $time; // display time in PST (-8)
?>
#5
Posted 11 December 2005 - 03:34 AM
$Time=date("g:i A T");will echo
2:53 PM MST
How do I make MST say PST? Isnt there a O operator that sets timezones? I don't know how to use it.
#6
Posted 11 December 2005 - 07:14 AM
<?php date_default_timezone_set('PST'); date(stuff); ?>
Edited by Avalanche, 11 December 2005 - 07:15 AM.
#7
Posted 11 December 2005 - 12:31 PM
#8
Posted 11 December 2005 - 04:06 PM
echo date('g:i A', time()-(60*60)).' PST';
Edited by rc69, 11 December 2005 - 04:08 PM.
#9
Posted 12 December 2005 - 08:17 PM
check it out: www.adminalliance.net
#10
Posted 27 October 2009 - 06:30 PM
I'm working on a project that checks today's date against one in the mysql database. I can write a function in a php script to check. However if the php script is just sitting there; then what actually starts the process of the check function; besides an inefficient continuous loop?
Thanks
#11
Posted 27 October 2009 - 10:05 PM
You would create a cron job to run the php script every day.Hi,
I'm working on a project that checks today's date against one in the mysql database. I can write a function in a php script to check. However if the php script is just sitting there; then what actually starts the process of the check function; besides an inefficient continuous loop?
Thanks
#12
Posted 27 October 2009 - 10:07 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users