Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Date In Real Time


It is possible to create a program which get the date in real time using PHP.




View Complete Forum Thread with Replies

Related Forum Messages:
Problems With Php Date/time - Real Time Clock
On my website i would like to have a real time clock....i mean to show seconds
running one after another...how can i do this?

Another problem is how to get time into a variable (which then i will insert
into a database table)?

View Replies !
Real-time Output?
I'm a relative PHP newbie, so I apologize if this is a simple question.

Anyway, here's my problem. I'm using a PHP script to pre-render a bunchload of insert files for an HTML page. Right now there's about 1,600, but that number could get much, much higher when the site goes live.

I'll only need to re-render the whole batch once or twice a year (if that) but it's still something I'd like to be able to do in case I have to move the site to a different server, or there's a hard drive crash or etc.

Basically what the script does is grab a whole bunch of information from a database and write the insert file. It does this for every single one.

The problem of course, is that PHP by default does all this server-side, and then sends it to the browser. Because this process takes like ten or twenty minutes to do, the browser times out long before it's finished.

Is there a way to get progressive output with PHP? Or do I need to re-do this in another language like Perl?

View Replies !
Real Time Chat
There's anyone out there that can give me a light on real time chat using sockets. I've seen some using push technics but they all hang up after an elapsed amount of time.

View Replies !
Real-time Clock
Where should I start to write a Real-time Clock? I want it be dynamic, not static. I know how to get the time and display it but how do I keep changing it ?

View Replies !
Real-time Chat
I wrote a PHP chat system similar to gChat which simply uses constant ajax calls to update the chat. This system is fine for a few users, but with potentially thousands of users, it is much too hard on the server. I've been considering taking the 'Comet' route, but have heard that PHP can't handle Comet very well. What would be the best language/API to perform real-time chat for a large user-base?

View Replies !
Real Time Sql Query
I am making a web-based chat but to get the msg from the database i need to refresh the page and that will make load and extra bandwidth on the server so i want to make the query in real time ( only the new msg to be received without refresh the whole page ), Any one in here knows how to get data from sql database without having to refresh page.

View Replies !
Display The Date As A Real Date Xx/xx/xx
Basically im putting a join date into the database but i don't want it displayed as a date, i want it as pure numbers so that i can use it to work out things such as how long they've been a member, comments per day (by dividing the posts by how many days they've been a member) ect ect

So whats the best way of putting that into the database? I have a vBulletin forum and looked in the database at what they had for the join date and i saw stuff like 112823... is that seconds or something?

I also need to display the date as a real date xx/xx/xx so that must be possible aswell.

View Replies !
Real Time Echo'ing Of Var In A Loop
i have a big loop, and rather then waiting until its done for me too see what happened, every time it runs, how can i get the browser to echo the result, and proceed to keep running the loop.

basically this loop takes a long time to finish, and i had to set my max runtime past 30 seconds. i guess incorporating a refresh of some sort like this would eliminate the need for the time extension too?

View Replies !
Real Time Form Update
i have a script that i wrote for my clan/guild/linkshell in this online game i play that keeps track of members, the points they receive from events, items etc. in the admin panel of the script where you can update peoples points i want to know if i can add a button or something similar that if you push it updates the points which is currently in another text box in the same form in real time.

I'm sorry if i'm not being clear, what i'm trying to do it make it quicker to update a members points because usually after each event they receive either 10 or 20 so i want to add a button where if you push it then it will put 10 or 20 in the 'add' box in real time. right now when you edit a member it shows their current points in a text box and under that two text boxes, one if you want to add points and another if you want to subtract points.

if this isnt possible then i assume that i'd have to make it update the points in the box and keep all the values from before and just reload the page with the new value inside the box. wow, i'm sorry if i'm not very clear, please ask questions if you dont understand what i'm trying to say.

View Replies !
Real-time Action Ala Games??
What would be a proper solution for automated decision making in a PHP script, like a game? That is, without an external application, or any human input. For example, any random event that happens when the player is away from the game. How would one go about implementing that?

View Replies !
Real Time Listbox Update
I have one listbox that I populate with

while($row = mysql_fetch_array($result, MYSQL_ASSOC)

I need to in real time populate another listbox from a related table based on what they have currently selected in the first listbox. Is this possible with php and if so.

View Replies !
Read Data From MS Access Into MySQL In Real-time
I am currently working on a project that involves reading information from a inventory system into Access via ODBC and display the info on the web site using MySQL.

I would like to create a live link between the MS Access(local) and MySQL (remote) whenever the inventory system is updated MySQL will be updated as well.

I know that MyODBC will let me do the opposite of what I would like to accomplish by reading data in MySQL into Access. Is it possible to do the reverse way.

View Replies !
How Can One Get Real Time Stock Quotes For An Online-community?
For one of our web-communities we plan an offer of real time stock
quotes incl. advanced notification services. I have the following
questions:

- Do you know of any services, that already offers such services in a
decent way?

And more important:
- Does anybody know a provider of such services, that offers a
real-time stock quote data stream for such a usage at a decent price? I
only know of Deutsche Börse offering it for 1駨 Euro per month. That
is too expensive for us.

View Replies !
Date & Time Fields To Printed Date/time
How can i take data from date and time field and convert:

2003-02-26 to 26th of Febuary 2003

And: 19:25:00 to 7:25 PM

View Replies !
Converting TIMESTAMP Fields Into "real Time"?
Is there a code for converting a db field that is TIMESTAMP into "real time"?
Meaning if the field is 2007-03-21 10:51:28have is output: "10:51 am",
Or: 2007-03-21 13:51:28output: "1:51pm"?

View Replies !
Deduct Date/time From Daste/time To Display Hours/days Difference
what i'm wanting to do is take away date logged from date closed therefore leaving the time between the 2 date/time stamps so that i can work out the average time later on and display as average time: 1day 2hours .

View Replies !
Date Time UNIX DATE NOW(), TIME() DATE()
I'm so confused, I just want to put this: "Sat, 11 Jun 2005 06:10:50 MST" into a mysql date field!.

View Replies !
Show Time / Date To Reflect Eastern Standard Time
my web host is located on the west coast i live on the east coast so if my page shows the date:

$day = date(d);
$mth = date(m);
$yr = date(y);
echo $day . "-" . $mth . "-" . $yr;

i shows the date as of west coast time. so the time now is 1:40am april 6, 2007 my page will still show april 5, since west coast is 3 hours back. (10:40pm apr 5) how do i compensate for this time zone difference? i want my time / date to always reflect eastern standard time.

View Replies !
Convert Query Results To Time Date/time Format
i have a query which displays the start time, end time, and also the duration. these results are displayed, however the duration doesnt seem to display in the correct format, it is displayed as numbers but not in the correct format. Code:

View Replies !
A Real Challenge For Real PHP Programmers
<?php
/*
A challenge to every PHP programmer.The one who's gonna solve this
problem would be deemed as

PSP(PHP Supreme Programmer).The problem is this : You have to write a
script that displays a list of

categories and subcategorieslike this one:

<select name="category">
<option value="1">Main</option>
<option value="2">Main > Computers</option>
<option value="4">Main > Computers > Hardware </option>
<option value="8">Main > Computers > Hardware > PC</option>
<option value="7">Main > Computers > Hardware > Mac</option>
<option value="9">Main > Computers > Hardware > Atari</option>
<option value="11">Main > Computers > Hardware > PC > History of
Pc</option>
<option value="">etc...</option>
</select>

The categories and subcategories details are stored in these two
tables in a MySQL database.
-categories : the categories names and ids.
-cat_relations : the relations between categories.It shows which
subcategory belongs to which category.
The belongings between categories can go very deep and the number of
categories is unlimited. This script will create the two tables and
fill them with sample data. All you need to do is to change the four
variables below. You can send the script back to this email :
yasbergy@yahoo.com.
*/

//Here starts the script. Please change the values of these variables
to fit your settings
$user = "prospective_PSP";
$database = "db";
$server = "localhost" ;
$pwd = "" ;
//Connection to the database that you created
mysql_connect($server,$user,$pwd) ;
mysql_select_db($database);
//Creation of the two tables : categories and cat_relations
$categories = " CREATE TABLE `categories` (`id` INT not null
AUTO_INCREMENT, `name` VARCHAR(100) not null , PRIMARY KEY (`id`),
INDEX (`id`), UNIQUE (`id`)) comment = 'The categories details' ";
mysql_query($categories) ;
$cat_relations = "CREATE TABLE `cat_relations` (`id` INT not null
AUTO_INCREMENT, `daughter_id` INT not null, `mother_id` INT not null ,
PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'Which
category is the daughter of which category'";
mysql_query($cat_relations) ;

//Filling the two tables with sample data
$cats = array('Main','Computers','Countries','Hardware','S oftware','Programming
languages','Mac','PC','Atari','Winamp','History of the
PC','IBM','Components','High
level','USA','NYC','LA','Manhattan','India','Winzi p');
for ($i=0;$i<count($cats);$i++){
$sql = mysql_query("insert into categories (name)
values('".$cats[$i]."')");
}
mysql_query("insert into cat_relations (daughter_id,mother_id) values
(2,1),(3,1),(4,2),(5,2),(6,2),(7,4),(8,4),(9,4),(1 1,8),(12,8),(13,8),(10,5),(20,5),(14,6),(15,3),(16

,15),(17,15),(18,16),(19,3)");
//Now you can have a look on them through phpMyAdmin
?>

View Replies !
Help: Date Function Not Returning Correct Date & Time
I have just notices that the date() function is not returning the correct
date/time on my "server".

I am running apache2 on my winxp pro laptop.

My system clock is set to the correct date, time and timezone, get the
results returned by date() are 11 hours behind.

View Replies !
Formate Date And Time To Time Stamp
How can I transform the out put of a date() function into a timestamp e.g date(H:i:s)

View Replies !
Return The Current Date/time Using Date('c')
I'd like to return the date in this format:

2006-05-09T18:00:00-08:00

I've tried using date('c'), but that doesn't appear to be working. Is there another way that I can return the current date/time in this format?

View Replies !
Db Update And Real Time Update
i wanted to put together my first pages using prototype but i'm kinda stuck. situation:

i got a list of pages in the backoffice. in the list you got pagenames, id's, editors and if they're active or not. the active part part is represented by an in/active image.

now instead of having to edit the page and change a checkbox to toggle the active status of the page, i was planning to make it able to click on the image in the list itself to toggle the status of the page. thus updating the db when you clicked and refresh the list using ajax. Code:

View Replies !
Time Difference - $time = Date('H:i');
i am in the uk but my server is american so everytime i use:

    $time = date('H:i');

it comes up with a time that is 6 hrs behind my time, is there anyway i can rectify this?

View Replies !
Date Time Not Accurate For Date();
echo "date=".date('Y-m-d h:i:s');
date=2007-11-15 15:48:14

the clock is the accurate at here..showing only 3pm ..while now my pc showing 11.51pm(localtime)

View Replies !
Re-arranging The Date Without Time() Or Date?
I have dates logged in a MySQL table of when people are logged in in my site, the date gets entered into the table like so: 2007-01-17 19:18:58, i am using MX Kollection for Dreamweaver to create the site so I cant really change the fields to integar and use the time() function as it comes built with the extension Code:

View Replies !
Question About The "date / Time" Continuum - Timestamp Or Add Date As Varchar?
I have a new project that consists of work order tracking. It's nice cause I can use a lot of the same code from my last project which was delivery tracking. However when I tried to create a MySQL table using two timestamp fields, it stopped me. MySQL will only allow one timestamp.

So I did some googling and now am thinking I can use the php date function to get the date format of my choice and post the results into a textfield then post to MySQL as a varchar.

I'll still be able to sort date records the same in my queries and it's easier for me as a n00b to manipulate the data; Ditching the time and creating expressions / queries on timestamp fields gives me fits. Code:

View Replies !
Date And Time Help
I have a mySQL field that is a timestamp(14). I know that mySQL's NOW() function will insert the current timestamp into that field, but I need to do it a little different. I have a variable called $days that may be 30, 60, or 90, and I want my database to hold the equivalent of NOW() + $days. For example, I might need the value of the timestamp to be 30 days from the present. I figure the best way to do this is to use PHP's mktime() to construct a $futuretime variable that holds the timstamp I want and then insert it into mySQL and bypass the use of mySQL's NOW(). Can someone offer advice on how to do it this way, or on a better solution?

View Replies !
Date With Time
I want to display at the current time like this PHP Code:

View Replies !
Time And Date.
It's all fine locally but on web host they are in different location so it's all setup for them on the web server.

How can I have the time() and date() functions etc return in my timezone?

I'm in AU, Sydney (GMT+10)

View Replies !
Date And Time...
I'm only just starting now to learn how to use date and time... What I'm trying to do is get a timestamp from the database then get the current time then what I want to do is compare the two to see if it is less than x minutes ago but I don't know how to compare timestamps, any tips/pointers?

View Replies !
PHP Date/time
Can u show me an example in where the function date_create is used ?

View Replies !
Date/Time
Anyway here is what im trying to do, this may seem really stupid to advanced people.

I have 2 fields 'jailstart' and 'jailend'

when they go to jail i update jailstart with date("U") and then jailend with date("U")+120; < So 2 minutes.

but now i need to display it as such so it says You have 2 minutes left in jail. So i need to convert date("U") to minutes if thats possible or even doing this another way

View Replies !
Date And Time
I have links from MONDAY to FRIDAY and when the user clicks on the link it will send the script a value of 1-5 . 1 through 5 equals mon,tue,wed,thr,fri. Now my problem is I need to take that 1-5 and convert it to the DAY its on. Meaning, today is Saturday(23rd) if they click Monday(Happends to be xmas) it woudl show the date 25th. how I can do this? or a better way to do it?

View Replies !
Date & Time
i wana ask about PHP Version 4.3.11 use. Is there a way to get a count of every item submited to your database table on a given weekday. This info is stored using the date time format.

I was wondering can I grab a count on how many where submited on a monday and so on. also is it possible to select say a given time or perhaps x amount submited in the am period or pm period. I have looked around but date time is my nemisis or is turning out to be my nemisis.

View Replies !
Time() To Date()?
How can I get my timestamp to output to a date

Example:
$time = time();
$date = date("F jS, Y");

How would I get the $time to turn into the $date?

View Replies !
Php Date/time ?
how to i tell php to execute something if 30 days has already passed ?

View Replies !
Time / Date
I have a database that stores comments to pictures on my site, each comment has the time attaced to it. February 9, 2006, 11:03 pm. I want a page that displays comments from today.

$date1 = date("F j, Y, g:i a")
$sql = "SELECT * FROM comment WHERE comment_date = '$date1'";

But the only problem is the time? because it will only show comments added at 11:03pm .

View Replies !
Specified Date And Time
I have a page I would like to only load on a specified date and time. How would I go about this. In other words, if someone went to the page before the defined time/date, it would say something like "Thank you, please come back in X days". On the assigned date, the full content of the page would load. Does this make sense?

View Replies !
Date Time
At the moment, $date = date("Y/m/d"); What would i assign to $date if i wanted to insert into a 'DATE TIME' table cell the date AND the time?

View Replies !
Date Time If{} Etc
I am currently working on a page that will display text from a certain date untill another date

what i want to happen is

if(the current time is between $timea + $timeb) {echo"text";}

else{whatever...;}

$timea will be saturday and timeb will be two weeks after. (during this time i the if to execute the code i put in the if statement when the page is loaded of course.)

What is my best approach towards getting this done?

View Replies !
Time() & Date()
im printing this to the screen:

<?
date('d-m-y  h:i ' , time() );
?>

but for some reason the time() always late in a few hours. u can c in the image the difference between the clock of the windows xp and the time() function. if im changing the clock, the time() will also change.

XP home , wamp , php5.

any ideas?

View Replies !
Time() To Date
I am storing my time in a databse but i want to take it out and show it as a date like 7-12-2007 how can i convert the time() into the date? I dont care about hour minute second i just want the date.

View Replies !
Time/Date Format
I'm pretty sure there is a way to do this, but I don't know what the code is to do what I'm trying to get.

Is there a way to get the current date and time in YYYYMMDDHHNNSS format (as an example, 20001030111100)? I would guess you can but I don't know what the code is.

View Replies !
Current Time And Date In Php
I want to store the current time in a mysql database with php. I would like the format to be: yyyymmddttmmss but any format will do for now.

View Replies !
Date And Time Different From Server
My current time offset is GMT wich is different from the server that I use, what I want to do is to create a $time variable and a $date variable with the time in the GMT offset and not the server's offset. I think I have to use mktime to do this but I don't know how to use it. I wnat the $time in "hh:mm" format (24h) and the $date in "dd/mm/yyyy" and also one (let's say $date2) in "dd/mm".

View Replies !
Determining Date/time
I'm retreiving all timestamps by user_id from a database and want to print to screen the week that the date falls in. For example, if I retrieve today's date - 07/24/01, a tuesday, I want to create a link - 07/24/01-07/29/01. (which is Monday - Sunday.)

I want to retrieve all of the timestamps, and loop out the results in the format above (eg. 07/24/01-07/29/01) for every date in the table. The results would look like this:

07/24/01-07/29/01
07/30/01-08/05/01
08/06/01-08/12/01

Sample code that I have is below, I have been going back and forth trying to do this with mysql functions, or doing it with php date() The second query is commented out, but this was another way that I was considering doing this. I can't figure out how to find the week, Monday-Sunday, of any given date. Sample Code:

View Replies !
Current Date-time In Php
i want to store the date and time when the user registered i.e. the
record is entered in my table.

so how can i achieve this?

should i use php or mysql to achieve this?

which is more proper and how can i get date-time?

View Replies !
Date And Time Stamp
I am trying to write a date and time stamp to a file
Date("d-m-y") is ok but time(void) gives me 1124528448
Can I format time into a H:M:S format

View Replies !
Timestamp - Date And Time.
when i use this function for modificaton time of a file: $fdate = filemtime($file); i only get the date, but i want date and time.

View Replies !
Date/time Problems
I'm storing the times of events (posts to a messageboard) in a mySQL database by using PHP's time() function, which, as I understand it, returns a UNIX timestamp measuring the number of seconds since midnight 1/1/1970 GMT.

When I retrieve this UNIX timestamp and apply date() formatting to it, the time is wrong - apparently off by four hours. For example, it's 1:30 PDT (California) time now. My time zone is GMT minus 7, which means it's 8:30 GMT. But the date() function, applied to the timestamp, tells me it's 4:30 GMT instead.

By the way, the server is hosted in Montreal, Canada (GMT-4) (on Windows 2000). Perhaps date() is telling me Montreal local time instead of GMT time? It's not supposed to do that, though...is it?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved