Current location: Hot Scripts Forums » Programming Languages » PHP » date problem... a bit complex


date problem... a bit complex

Reply
  #1 (permalink)  
Old 07-31-05, 09:37 PM
piratinc piratinc is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Question date problem... a bit complex

Hi there,

I am trying to make a game and in that game I have custom day lenght... actually 24 hours must be completed in 4 hours.
I have a start date like will be shown in the script below and I want to calculate so I can always show the game time and day

$startjoc = "0731033247";
$momentuljocului = date("mdHis");
$joctimpscadere = $momentuljocului - $startjoc;
$secundajocului = $joctimpscadere / 60;
$minutuljocului = $joctimpscadere * 6 / 60;
$orajocului = $joctimpscadere * 6 / 3600;
$ziuajocului = $joctimpscadere * 6 / 86400;

$secundajocului = explode(".",$secundajocului);
$minutuljocului = explode(".",$minutuljocului);
$orajocului = explode(".",$orajocului);
$ziuajocului = explode(".",$ziuajocului);

echo "Day $ziuajocului[0] Time $orajocului[0]:$minutuljocului[0]";


this is what I have tried but at an end didn't work... can anyone if I made myself pretty clear what I am trying to do to give me a hint here, please?

Thanks in advance!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie found a solution to a date problem. mickey_kamer Perl 4 05-09-07 05:54 AM
Date function problem mehendaleparesh PHP 3 12-30-04 10:31 AM
Please Solve SQL Date Range Problem ishaqani ASP 0 12-11-04 03:59 PM
date problem jaishalg PHP 1 06-15-04 08:28 AM
Problem with date and form djavet PHP 3 05-02-04 12:37 AM


All times are GMT -5. The time now is 07:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.