The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
vbdate() function
I am not able to retrieve the current time according to user's timezone settings using vbdate()
I am using this, but this always shows 01st of January, 1970:- PHP Code:
PHP Code:
Thank You |
#2
|
|||
|
|||
vbdate function takes UNIX time not in a format such as YYYY-MM-DD HH:MM:SS which is returned by mysql when a column is in date format.
|
#3
|
||||
|
||||
so how to solve the problem ? please explain programmatically. How to insert current date/time so that vbdate() works.
|
#4
|
|||
|
|||
Make the database column an integer(11), use TIMENOW as current value to insert and use vbdate() to make it a displayable date in the users TZ.
|
#5
|
||||
|
||||
Thank you, it works great now.
Is there a way to do just the vice versa of it ? Now I want to convert the displayed form into unix timestamp format and insert it, how should I do it ?? This is the process what I want to do:- 1. Insert date in unix format. 2. Retrieve it in desired format with vbdate(). 3. Edit the retrieved date. 4. On submit, convert it in unix timestamp and insert it. Need help with steps 3 and 4. Thank You |
#6
|
|||
|
|||
You can use the mktime() function or better the vbmktime() wrapper.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|