Hi,
How can I have a text object with data + time?
Thank You,
Best Regards,
Rui
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Date and Time
Re: Date and Time
Rui,
You can just use a wider text area and make a JavaScript function to validate it.
http://stackoverflow.com/questions/4460 ... javascript
nuBuilder has no built in format for that.
Steven
You can just use a wider text area and make a JavaScript function to validate it.
http://stackoverflow.com/questions/4460 ... javascript
nuBuilder has no built in format for that.
Steven
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Date and Time
Hi Steven,
I am using in the form "before open":
Result is not correct! I get tomorrows date.
If I use:
... the now() function doesn't work!
Any idea why is not working? I have checked the dates in my systems and are correct.
Thank you!
Best regards,
Rui
I am using in the form "before open":
Code: Select all
$sql = "SELECT CURDATE() AS date";
$result = nuRunQuery($sql);
$date = db_fetch_object($result);
$date = date("d-M-Y");
$javascript = " function nuLoadThis() {\n";
$javascript .= " if (document.getElementById('unit_date').value == ''){\n";
$javascript .= " document.getElementById('unit_date').value = '".$date."';\n";
$javascript .= "}}\n";
addJSFunction($javascript);
If I use:
Code: Select all
$sql = "SELECT now() AS date";
$result = nuRunQuery($sql);
$date = db_fetch_object($result);
$date = date("d-M-Y H:i:s");
$javascript = " function nuLoadThis() {\n";
$javascript .= " if (document.getElementById('unit_date').value == ''){\n";
$javascript .= " document.getElementById('unit_date').value = '".$date."';\n";
$javascript .= "}}\n";
addJSFunction($javascript);
... the now() function doesn't work!
Any idea why is not working? I have checked the dates in my systems and are correct.
Thank you!
Best regards,
Rui
BR
Rui
Rui
-
- Posts: 2
- Joined: Wed Apr 04, 2012 11:08 am
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
Re: Date and Time
Hi MichaelD,
Yes it is correct:
mysql> SELECT CURDATE() AS date;
+------------+
| date |
+------------+
| 2012-04-17 |
+------------+
1 row in set (0.00 sec)
-----
Any other idea?
Best Regards,
Rui
Yes it is correct:
mysql> SELECT CURDATE() AS date;
+------------+
| date |
+------------+
| 2012-04-17 |
+------------+
1 row in set (0.00 sec)
-----
Any other idea?
Best Regards,
Rui
BR
Rui
Rui
Re: Date and Time
Rui,
this will give you date and time
Steven
this will give you date and time
Code: Select all
$sql = "SELECT now() AS date";
$table = nuRunQuery($sql);
$row = db_fetch_row($table);
$date = $row[0];
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm