pathans
Posts: 46
|
Posted: 10/18/2012, 6:41 PM |
|
I am trying to use this function in my page to save last update date.
it works but then it when the date shows up its showing date as something in 1970
DBformat for my table is yyyy-mm-dd HH:nn:ss
filed which is showign date is formatted like mm/dd/yyyy h:nn AM/PM
I want to get current date and time stamp in this example (date and time both)
function LastUpdateInfo(){
global $Tasks;
$Tasks->LastUpdateDate->SetValue(date("m.d.y"));
$Tasks->LastUpdateUserid->SetValue(CCGetUserID());
}
function Tasks_BeforeInsert() {
LastUpdateInfo();
}
function Tasks_BeforeUpdate() {
LastUpdateInfo();
}
|
|
|
pathans
Posts: 46
|
Posted: 10/19/2012, 11:25 AM |
|
got it working.
just changed it from this
$Tasks->LastUpdateDate->SetValue(date("m.d.y"));
to this
$Tasks->LastUpdateDate->SetValue(time());
and it worked.
|
|
|
bannedone
Posts: 273
|
Posted: 10/19/2012, 2:10 PM |
|
Good Job
Here is undocumented info on how CCS deals with time values in date controls that might be of value to you in the future.
http://forums.yessoftware.com/posts.php?post_id=97052
_________________
John Real
CodeCharge Studio Support, Training, Consulting, Development, Web based solutions
http://realsites.biz
http://ccselite.com
Other Banned IDs on this Forum. jjrjr1, jjrjr2 |
|
|
|