The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I worked out thanks to someone here at .org how to put a unix timestamp into a readable format with the date() function
![]() Now say if im inserting time() into a field in a table e.g. [sql] UPDATE timer SET time='".time()."'; [/sql] How would i adapt that query to add a year to the current time? Thanks in Advance - miSt |
|
#2
|
||||
|
||||
|
WTF bug in the sql code alert
![]() It was meant to read: UPDATE timer SET time='"time()'"; - miSt |
|
#3
|
||||
|
||||
|
erm. '". isn't a sql query, you are trying to mix up php and mysql so you should use php or code tags
![]() updateing timefield to add a year: [sql]UPDATE timer SET time=time+3600*24*356[/sql] |
|
#4
|
|||
|
|||
|
|
|
#5
|
|||
|
|||
|
time() returns a date in epochs which implicitly has the year.
|
|
#6
|
||||
|
||||
|
I had to do this in the end
![]() PHP Code:
|
|
#7
|
|||
|
|||
|
What does the +3153600 do? Being the time is from the Epoch, it will have year.. I am still unsure why you are adding the extra numbers in :\
|
|
#8
|
||||
|
||||
|
It simply adds a year to the current timestamp outputted from the time() function
![]() - miSt |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|