Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Valid code?

by Marshall (Canon)
on Mar 19, 2020 at 01:27 UTC ( [id://11114449]=note: print w/replies, xml ) Need Help??


in reply to Valid code?

$no_days = "(TO_DAYS(dateadded)-TO_DAYS(Now())>=-$newdateadded)";
Without running any code, it appears to me that you have a "units" problem. dateadded and Now are transformed by the TO_DAYS function but their difference is being compared to $newdateadded. Why doesn't TO_DAYS() apply to all 3 terms? Aside from that, this is string, why not:
$no_days = TO_DAYS($dateadded)-TO_DAYS(Now()) >= TO_DAYS($newdateadded);

Put your code in a program and run it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found