Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-03-2003, 04:34 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
vbulletin time is weird

the date field in the vbulletin db is int(10)

i assume this is a unixtimestamp

"1046729556" is an example

i try to convert this to a time, and it doesn't work:
PHP Code:
<?
$this
->dateline=date("m-d-Y",$this->dateline);
?>
but it just prints out 12-31-1969

any ideas on this?
sde is offline   Reply With Quote
Old 03-03-2003, 06:05 PM   #2 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
12-31-1969 is 0 unix time. you are not passing in the value correctly.

PHP Code:
<?
  
echo date("Y-m-d"1046729556);
?>
i get:
2003-03-03
joe_bruin is offline   Reply With Quote
Old 03-03-2003, 06:27 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
ok, it was not liking the fact that i was using the same variable on the left as i was on the right. it maybe because they were array variables. i just set the initial variable that grabs the dateline into a non-array variable .. and it works great.

thanks for the check.
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
network time synchronisation in java bossebo Java 1 06-21-2004 06:17 PM
Adjusting date() function for time zones Epsilon PHP 1 02-27-2004 03:55 AM
Assign value to a variable depending on time AOD PHP 10 02-12-2003 04:06 PM


All times are GMT -8. The time now is 06:19 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting