erasing timestamp?

Hi all,

I've developing a fake social networking site for use in a social psychology experiment. I don't want the participants in the experiment (users on the site) to realize that the entire thing (blog posts, comments, profiles, etc.) were created months before they joined the site. Is there a way to change timestamps on things like blog posts and comments? I've looked all over and searched the site in various ways, but haven't found any tips on how to do this. I'd love to be able to set the comment/blog post so that it always seems to have been written a few days earlier.

If it's not possible to change the timestamps, an alternative would be to simply eliminate them. If this is easier, I'd love feedback on that too.

Thanks so much in advance!!

  • If everything was created months ago, you can fast-forward the time stamp possibly.  For example if the last thing was created 90 days ago you could do something like:

    $dbprefix = elgg_get_config('dbprefix');

    $fastforward = 60*60*24*90; // 90 days

    $q = "UPDATE {$dbprefix}entities SET time_created = (time_create + {$fastforward})";


    Do the same thing for time_updated, and again on the annotations/relationships/metadata tables.

    Not sure if there's any gotchas to beware of, this is definitely something you'll want to test first and have a reliable backup you can roll back to.

  • I came across this plugin just yesterday (not tested myself yet):

    You might be able to backdate at least the blog posts and pages using this plugin. With comments it's different because they are not Elgg entities but annotations. But maybe you can enhance the plugin on your own to meet your needs.

    Eliminating the timestamps might be possible by simply changing the output format of the friendly_time view. Instead of using the date format as it is you could simply not define any format at all.

  • Thanks folks! This is really helpful. I'll probably be back with troubleshooting questions, but this is at least a place to start.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking