Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
would this command work (date)
Old 02-09-2006, 08:05 PM would this command work (date)
Village Idiot's Avatar
Webmaster Talker

Posts: 535
Trades: 0
$todays_date = date("Y-m-d H:i:s");
if($todays_date>$sql_date)

sql date being a variable extracted from a sql db, the variables are in the same format. would this work?
__________________
I have the heart of a child, I keep it in a jar on my desk.
Village Idiot is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-10-2006, 01:52 AM Re: would this command work (date)
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Good question. I think it should... This test seems to work as you might expect:

PHP Code:
<?php

$date_one 
date('Y-m-d H:i:s');
$date_two date('Y-m-d H:i:s'mktime(000date('m'), date('j') + 5)); // 5 days future

if($date_one $date_two)
    echo 
'Works as expected! ';
else
    echo 
'Maybe not... ';
    
?>
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 02-10-2006, 06:00 AM Re: would this command work (date)
stOx's Avatar
Machine

Latest Blog Post:
Worlds Smallest Car - Peel P50
Posts: 2,111
Name: Matt. (>',')>
Location: London, England.
Trades: 0
I have never thought about comparing dates with greater or less than symbols.
That could come in handy.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
stOx is offline
Reply With Quote
View Public Profile Visit stOx's homepage!
 
Reply     « Reply to would this command work (date)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18264 seconds with 12 queries