saseow
Posts: 744
|
| Posted: 12/27/2008, 11:08 AM |
|
On my login form I have a text box called current_date. The data type is Date, the Format is yyyy-mm-dd and the Default Value is CurrentDate.
It displays the date perfectly as 2008-12-27.
I am trying to get this date into a variable to compare it with an expiry date stored in the users table. I can get the expiry date into a variable with :
$result = CCDLookUp("expiry_date","users","ID=".$db->ToSQL(CCGetUserID(),ccsInteger), $db);
no problem!
I cannot get the value from the current_date text box into a variable! I am using:
global $current_date;
$current_date = CCParseDate($Container->current_date->GetValue,"yyyy-mm-dd");
echo $current_date;
I have tried everything and cannot figure out my stupidity. I am going nuts with this. Please help if you can.
|
 |
 |
mentecky
Posts: 321
|
| Posted: 12/27/2008, 7:15 PM |
|
saseow,
try:$current_date = CCParseDate($Container->current_date->GetValue(),"yyyy-mm-dd");
Rick
_________________
http://www.ccselite.com |
 |
 |
damian
Posts: 838
|
| Posted: 12/27/2008, 7:18 PM |
|
it may be that you are trying to get the date from the label before the labels value is set.
why do you need to assign it to a label first?
what if you just did this?
global $current_date;
$current_date=date("Y-m-d");
echo $current_date;
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
damian
Posts: 838
|
| Posted: 12/27/2008, 7:22 PM |
|
Quote mentecky:
saseow,
try: $current_date = CCParseDate($Container->current_date->GetValue(),"yyyy-mm-dd");
Rick
Rick - that was my first thought but I couldnt get it to work and thought that the label might not have a value yet so i just set the variable and skipped the label?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
saseow
Posts: 744
|
| Posted: 12/27/2008, 7:35 PM |
|
Thank you both for the help! Damian, I used your direct approach. Sometimes one just gets into a rut and can't see the wood for the trees.
Thanks again.
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 12/28/2008, 6:27 AM |
|
BTW
If you want a description of how dates are implemented in CSS take a look here
http://ccselite.com/forums_topics_view.php?forum_id=8&forum_topic_id=7
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
saseow
Posts: 744
|
| Posted: 12/28/2008, 6:39 AM |
|
Thank you jjrjr1,
I have stored this info for future reference.
|
 |
 |