vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=321149

I want to get the current day and month of users
by SilverBoy
21 Dec 2015 19:23

Hi

I'm looking for a function to get the current day and month for user, I think there was a built in function to do this but I don't find it by search here.

Thanks in advance.

Dragonsys 21 Dec 2015 19:24

current day and month for user? I don't follow, do you mean you want to display the current month and day to users?

SilverBoy 21 Dec 2015 20:16

yes, I want the current day and the current month of the user (you know there is difference regarding to the time zone)

Dragonsys 21 Dec 2015 20:21

Like this line in the footer, with the current Month added (Month will not vary by user, unless it is right at the end/start of the month)

Quote:

All times are GMT -6. The time now is 03:20 PM.
This line uses the User's Timezone setting

CAG CheechDogg 21 Dec 2015 20:24

Try this mod ...

http://www.vbulletin.org/forum/showthread.php?t=243379

SilverBoy 21 Dec 2015 20:34

Quote:

Originally Posted by Dragonsys (Post 2560916)
Like this line in the footer, with the current Month added (Month will not vary by user, unless it is right at the end/start of the month)



This line uses the User's Timezone setting

I know that, but I need to get the exact day and month for the user who browse the forum in current time.
For example if there is a user browsing from USA when his watch is 2:00 pm it maybe 2 am for other user browsing from china and then they are in different days

--------------- Added 21 Dec 2015 at 20:37 ---------------

thanks, but unfortunately it doesn't help, I want the date for the user who browsing the forum at anytime.
I think I'm looking for something like maketime function.

Dragonsys 21 Dec 2015 20:41

Ok, well you can create a custom plugin and then use a template hook to place it. Where are you wanting this to appear on the page?

SilverBoy 21 Dec 2015 20:47

Let me explain what I'm looking for exactly.
I have a quote table every day has it is unique quote, the dates stored in database in two columns 1 for day and another one for the month.
So if today is 21 December, I must see the quote for day 21 and month 12 from that table, but other user browsing from china will see the quote for day 22.
could you please help me to get the current day and month for every single user browsing my site?

Dragonsys 21 Dec 2015 20:50

ok, making a bit more sense now :)
I assume you are using a custom plugin to display the quotes. Give me a bit and I will try to get you the code you need to add to your plugin.

SilverBoy 21 Dec 2015 21:00

Thank you

SilverBoy 22 Dec 2015 22:32

I'm still looking for function to do this thing ^_^

kh99 22 Dec 2015 22:58

I think you want the function vbdate(), in includes/functions.php. It takes a format string like the php function date(), so you could do something like pass it the string 'j,n' then explode it.

Dragonsys 23 Dec 2015 00:15

I'm thinking more along the lines of vbmkdate()


All times are GMT. The time now is 21:51.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.