PDA

View Full Version : I want to get the current day and month of users


SilverBoy
12-21-2015, 06:23 PM
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
12-21-2015, 06:24 PM
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
12-21-2015, 07:16 PM
yes, I want the current day and the current month of the user (you know there is difference regarding to the time zone)

Dragonsys
12-21-2015, 07:21 PM
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)

All times are GMT -6. The time now is 03:20 PM.

This line uses the User's Timezone setting

CAG CheechDogg
12-21-2015, 07:24 PM
Try this mod ...

https://vborg.vbsupport.ru/showthread.php?t=243379

SilverBoy
12-21-2015, 07:34 PM
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 1450733841 at 1450733841 ---------------

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
12-21-2015, 07:41 PM
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
12-21-2015, 07:47 PM
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
12-21-2015, 07:50 PM
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
12-21-2015, 08:00 PM
Thank you

SilverBoy
12-22-2015, 09:32 PM
I'm still looking for function to do this thing ^_^

kh99
12-22-2015, 09:58 PM
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
12-22-2015, 11:15 PM
I'm thinking more along the lines of vbmkdate()