$avatar->filename = $filename;
$avatar->original = true;
$avatar->url = common_avatar_url($filename);
- $avatar->created = date(DATE_RFC822); # current time
+ $avatar->created = DB_DataObject_Cast::dateTime(); # current time
foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
$scaled[] = $this->scale_avatar($user, $avatar, $size);
}
$scaled->mediatype = ($avatar->mediattype == 'image/jpeg') ? 'image/jpeg' : 'image/png';
$scaled->filename = $filename;
$scaled->url = common_avatar_url($filename);
- $scaled->created = date(DATE_RFC822); # current time
+ $scaled->created = DB_DataObject_Cast::dateTime(); # current time
return $scaled;
}
$notice = DB_DataObject::factory('notice');
assert($notice);
$notice->profile_id = $user->id; # user id *is* profile id
+ $notice->created = DB_DataObject_Cast::dateTime();
$notice->content = $this->arg('content');
- $notice->created = date(DATE_RFC822); # current time
return $notice->insert();
}
# TODO: wrap this in a transaction!
$profile = new Profile();
$profile->nickname = $nickname;
- $profile->created = date(DATE_RFC822); # current time
+ $profile->created = DB_DataObject_Cast::dateTime(); # current time
$id = $profile->insert();
if (!$id) {
return FALSE;
$user->nickname = $nickname;
$user->password = common_munge_password($password, $id);
$user->email = $email;
- $user->created = date(DATE_RFC822); # current time
+ $user->created = DB_DataObject_Cast::dateTime(); # current time
$result = $user->insert();
if (!$result) {
# Try to clean up...
$sub->subscriber = $user->id;
$sub->subscribed = $other->id;
- $sub->created = time();
+ $sub->created = DB_DataObject_Cast::dateTime(); # current time
if (!$sub->insert()) {
common_server_error(_t('Couldn\'t create subscription.'));
require_once('PEAR.php');
require_once('DB/DataObject.php');
+require_once('DB/DataObject/Cast.php'); # for dates
// default configuration, overwritten in config.php