PDA

View Full Version : Local time in postbit


DRJ
07-25-2013, 10:55 PM
In vbulletin 3 I had the user's local time in the post bit and was using this:

GMT+$post[timezoneoffset]

I tried getting this to work in vbulletin 4 but not having much luck.

If I do {vb:raw $post[timezoneoffset]} I get a value but am not sure how to get the current time to add that value to. Also not sure about DST.

Is the user's local time a variable I can simply use for this purpose?

Thanks

Lynne
07-26-2013, 02:15 AM
What *exactly* are you using in the postbit? You didn't actually write "GMT+$post[timezoneoffset]", so tell us exactly what you used to do and exactly what you have tried to do in vB4.

Amaury
07-26-2013, 02:41 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=243379" target="_blank">User's Local Time and Date in Postbit and Profile for vB 4</a>

DRJ
07-26-2013, 05:45 AM
It was based on a custom field that would show an image of the user's country flag and on hover would show the country name and the user's local time. This is what I had in postbit_legacy for 3.5.

<div class="smallfont">
Location: <img Title="$post[field8] (GMT+$post)"
src="http://www.vbaexpress.com/forum/images/flags/$post[field8] 3D.gif"
alt="" align="center" />

This was done a long time ago so I don't really recall how it was setup. Not sure if GMT was a custom variable, I searched the plugins and that text was not found.

--------------- Added 1374823196 at [TIME]1374823196 ---------------

{vb:raw post.localtime} seems to do what I want.