MyBB Community Forums

Full Version: Converting time ago to timesamp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How i can change time ago to timesamp? thanks.
you can try using Absolute Time plugin
This is how I did it. You insert a dateline for it to convert:
<script src="jquery.timeagopost.js" type="text/javascript"></script>
			
<script type="text/javascript">jQuery(document).ready(function() {
  jQuery("abbr.timeago").timeago();});
</script> 
			
<script type="text/javascript">
  var time = document.getElementsByTagName('script');
  time = time[time.length - 1];
  var RelDate = document.createElement('RelDate');
  RelDate.innerHTML = jQuery.timeago(new Date({$post['dateline']} * 1000).toISOString());
  time.parentNode.insertBefore(RelDate, time);
</script>

But it's easier to just edit MyBB's time function: https://github.com/mybb/mybb/blob/featur...s.php#L332