You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 55 guest(s) and 2 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - block-Helius-Forums.php - altering timezone? [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Debz
Nuke Cadet
Nuke Cadet


Joined: Apr 27, 2004
Posts: 6


PostPosted: Thu Aug 12, 2004 8:11 pm Reply with quoteBack to top

My center block for recent forum posts uses the unixtime to find the 'last posts' made but im in a different country (and all of my users) to where our site is hosted...

is there any way in this block to add or change something to make it possibly use the forum's timezone? - as that is set to the correct date & time.

i think its somewhere in this piece of code:

Code:
$result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($poster_id, $post_time)=sql_fetch_row($result3, $dbi);


ive also taken some screen shots of what the time differences are:
(the first pic shows the correct time)

1: Image
2: Image
Find all posts by DebzView user's profileSend private message
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Mon Aug 16, 2004 11:42 am Reply with quoteBack to top

This is as close as I can get it.
change this part
Code:
post_time,'%m/%d/%Y at %H:%i'

to this
Code:
post_time,'%b %d, %Y at %T'


that will display it as
Jul 29, 2004 at 16:34:56 better than what it was.
The time will stay at military, I do not know how to alter that. The time zones in the Forums don't matter. The block will display the time that the post was made, which is correct on your two images. Just one is Standard time and the other Military.

_________________
Getting Started | My Projects
Find all posts by mikemView user's profileSend private message
supermenx
Nuke Soldier
Nuke Soldier


Joined: Apr 07, 2004
Posts: 14


PostPosted: Thu May 05, 2005 3:25 pm Reply with quoteBack to top

I finally find it out, its now very simple, add this in:

FROM_UNIXTIME(post_time +32400,'%b %d, %Y at %T')

+32400 is + 9 hours (3600x9=32400),
just multiply 3600 with number of hours, and you'll get your GMT, and add it after post_time

Its really working! Yeah! Mr. Green
Find all posts by supermenxView user's profileSend private message
Mael
Nuke Cadet
Nuke Cadet


Joined: Feb 23, 2004
Posts: 3


PostPosted: Tue Sep 27, 2005 7:36 am Reply with quoteBack to top

mikem wrote:

Jul 29, 2004 at 16:34:56 better than what it was.
The time will stay at military, I do not know how to alter that. The time zones in the Forums don't matter. The block will display the time that the post was made, which is correct on your two images. Just one is Standard time and the other Military.


To change the time from military time to a 12 hour format change

%b %d, %Y at %T

to

%b %d, %Y at %r


Here are the possible variables

%% PERCENT
%a day of the week abbr
%A day of the week
%b month abbr
%B month
%c MM/DD/YY HH:MM:SS
%C ctime format: Sat Nov 19 21:05:57 1994
%d numeric day of the month, with leading zeros (eg 01..31)
%e numeric day of the month, without leading zeros (eg 1..31)
%D MM/DD/YY
%G GPS week number (weeks since January 6, 1980)
%h month abbr
%H hour, 24 hour clock, leading 0's)
%I hour, 12 hour clock, leading 0's)
%j day of the year
%k hour
%l hour, 12 hour clock
%L month number, starting with 1
%m month number, starting with 01
%M minute, leading 0's
%n NEWLINE
%o ornate day of month -- "1st", "2nd", "25th", etc.
%p AM or PM
%P am or pm (Yes %p and %P are backwards Smile
%q Quarter number, starting with 1
%r time format: 09:05:57 PM
%R time format: 21:05
%s seconds since the Epoch, UCT
%S seconds, leading 0's
%t TAB
%T time format: 21:05:57
%U week number, Sunday as first day of week
%w day of the week, numerically, Sunday == 0
%W week number, Monday as first day of week
%x date format: 11/19/94
%X time format: 21:05:57
%y year (2 digits)
%Y year (4 digits)
%Z timezone in ascii. eg: PST
%z timezone in format -/+0000
Find all posts by MaelView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.362 Seconds - 345 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::