MyBB Community Forums

Full Version: Unix timestamp through Mycode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to print the current unix timestamp using mycode? Can it be so that I write [time] and the unix timestamp gets printed? Would appreciate any help possible. Thanks.
just curious - what is the purpose of it ... i.e. why you need to post Unix TimeStamp
Regular Expression: \[time\]

Replacement:

<script language="javascript">var mytime = Math.round((new Date()).getTime() / 1000);
document.write(mytime);
</script>

That should work.
Thank you Malcolm worked perfect Smile

Ranjani it has to do with some posts and links that need to stay updated according to the unix time stamp.
No problem, glad it works. Smile
Is there any way to use mycode within a mycode? for example..

[url=http://www.example.com/?id=[time]]example[/url] 

]example ?

is this possible? because it wont work.. is there a work around or maybe im missing something..