diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-05-17 16:14:11 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-05-17 16:14:11 -0400 |
commit | 564694c2f1799174fdf914f08d0ca9d8d2325c32 (patch) | |
tree | 27dc682968bbf29984517690d1bde57949f06081 /actions | |
parent | a88e18e5af2383f209fada762721a06488749d7f (diff) |
use cast object for datetimes
darcs-hash:20080517201411-84dde-7a6195517a5bded7b84266f61c035e2adbc49edd.gz
Diffstat (limited to 'actions')
-rw-r--r-- | actions/avatar.php | 4 | ||||
-rw-r--r-- | actions/newnotice.php | 2 | ||||
-rw-r--r-- | actions/register.php | 4 | ||||
-rw-r--r-- | actions/subscribe.php | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/actions/avatar.php b/actions/avatar.php index 0b1025a3c..f378b3d15 100644 --- a/actions/avatar.php +++ b/actions/avatar.php @@ -123,7 +123,7 @@ class AvatarAction extends SettingsAction { $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); } @@ -181,7 +181,7 @@ class AvatarAction extends SettingsAction { $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; } diff --git a/actions/newnotice.php b/actions/newnotice.php index 50d676eb5..fa7badd3d 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -47,8 +47,8 @@ class NewnoticeAction extends Action { $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(); } diff --git a/actions/register.php b/actions/register.php index c156b46b2..5c30fa1b3 100644 --- a/actions/register.php +++ b/actions/register.php @@ -81,7 +81,7 @@ class RegisterAction extends Action { # 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; @@ -91,7 +91,7 @@ class RegisterAction extends Action { $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... diff --git a/actions/subscribe.php b/actions/subscribe.php index 68fdd24e9..4edf3e714 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -48,7 +48,7 @@ class SubscribeAction extends Action { $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.')); |