Nov 21, 2009

Displaying Date And Time (gmt+8)

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

Displaying Date And Time (gmt+8)

dvayne
how to display date and time (gmt+8)? any help would be appreciated.

Comment/Reply (w/o sign-up)

jlhaslip
the php manual might be handy for this.

http://docs.php.net/manual/en/function.date.php
http://docs.php.net/manual/en/function.time.php

There are many time and date functions available to you in php. Those links should get you started.

Comment/Reply (w/o sign-up)

Amezis
To display the date and time, follow the links posted by jlhaslip. If the server is located in another timezone, you will need to use date_default_timezone_set() to set another default timezone before you use time() and date(). More information about this function can be found at http://docs.php.net/manual/en/function.dat...imezone-set.php (click here to see a list of all supported timezones). Hope that helps smile.gif

Comment/Reply (w/o sign-up)

dvayne
example please..

Comment/Reply (w/o sign-up)

coolcat50
Ok, to do this the simple, but not fully accurate way use a code like this.

CODE
<?php
$date=date(D,F,J);
echo $date;
?>


There is a little code.

Comment/Reply (w/o sign-up)

dvayne
thanks, I know it already

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : displaying, date, time, gmt, 8,

  1. Php - Fetching Random Line From A Text File
    and displaying it using AJAX/iframe (0)
  2. Php Date()?
    timezone is offset (4)
    Hi my timezone is GMT and the code im using to display the time and date is this: CODE
    date('l j F - g:i a') which would then display "Tuesday 25 March - 12:11 am" But the
    time for me at the time was 07:11 am. Anyone know how to tune it so it is with GMT time?....
  3. Displaying 10 Records Per Page
    (5)
    how to display 10 messages per page? CODE     include("config/config.inc.php");
        include("config/dbcon.php");     include("checksession.php");              if(isset($_POST )){
            $gname = $_POST ;         $gemail = $_POST ;         $gmsg = $_POST ;         $date =
    date("m.d.y"); $sql = "insert into tblguestbook "; $sql .= "(guestname, guestemail, guestmessage,
    guestdate)"; $sql .=" values('$gname','$gemail','$gmsg','$date')";
        mysql_query($sql);     } ?> My Guestbook body {     background-color: #000000;
    }....
  4. Displaying Your Phone Number On A Wap Site
    (3)
    I have a wap site elitezone.co.za and what i want to add is a code to the index page that displays
    your operator and phone number. Does any one know the coding for this function if so please show me
    here. Help will appriacated. Topic title modified. ....
  5. Php Date() Problem [resolved]
    date() seems to loop same ninute. (4)
    My setup is a macbook pro and I have apache+ mysql + php already included I think. the php is
    version 4.4.4 I have been using the date() to store dates into my mysql tables in the past and it
    worked corectly. I dont know what could of happen but now the date() function is returning an
    incorrect time. I made a test script test.php CODE $date_time = date('y-m-d H:m:s');
    echo($date_time); ?> and loaded it up. My laptops system time would be 1.35.33 PM and the date
    and time returned from php would be 07-06-28 13:06:56 I would hit refresh on the brow....
  6. Display The Current Date/time
    With a simple PHP code (4)
    Use this code to display the current date and time. CODE   $date = date('l dS \of F Y
    h:i:s A');   echo "$date"; ?> "l" would display the current day of the week such as
    Sunday. d displays the day of the month... such as 1 and S adds the appropriate suffix(st). /of
    simply displays the word "of". F displays the current month with no abbreviations while Y displays
    the four digit year(2007). "h" displays the current hour with leading zeros if necessary(Ex. 06 for
    6 o'clock). "i" displays the minute of the hour with leading zeros if necessary. ....
  7. Simple Php Calendar And Yahoo! Calendar Connection
    linking each date to Yahoo! calendar (7)
    Original simple PHP calendar source here I was looking for a simple PHP generated calendar. But I
    wanted to place detailed information to show on demand. And installing another database with
    separate management would have been too much of access codes and passwords to remember. And what if
    I want someone else to manage the calendar when I am not able? This is my version of using simple
    PHP calendar script to link to Yahoo! calendar. The twist is that figuring out how Yahoo! calendar
    selection worked. And then depending on which date was clicked it will bring up the a....
  8. Displaying Files Of A Directory
    (2)
    I want to display the contents of a directory.. i have the following code.. It gives the output in
    one column only... like file1 file2 file3 file4 . . . . . Since there are lot of files so this
    column gets very long..i want to display the x number of files in each column.. like if there are 22
    files.. then file 1 file 11 file 21 file 2 . file 22 file 3 .. . . . file 10
    file 20 This was just an example..I know it can be done by using but i dont know how to do it
    with loop. Please help me. QUOTE $dir = './'; $handle = opendir($....
  9. Directory Files Displaying
    (5)
    I have many files in a directory..I want to create a page , like A B C D E F ..... when some one
    click on A , it should display all the files starting from letter A , and when clicks on B , it
    should show all the files in that directory starting from B , and so on... I have no idea how to
    display the files of the directory iin that way. Kindly assist me......
  10. Displaying Latest Added Files Of Subdirectories ?
    (5)
    For example,i have a directory , which has 3 sub directories a,b and c...and i have some files in
    all subdirectories.. is it possible that i can display the latest added files to any of sub
    directory a,b, or c.?i think i will have to use sort by date function but how it should be done that
    it compares the files of all the subdirectories directories ?....
  11. Adding One Day To Date
    i'd like to add one day to date (9)
    I would like to add one day to date.Doesn't any one have a simple code that I can have. or mabe
    a link. date("Y-m-d H:i:s") + (1800 * 24);//this doesnt work ;/ but i need to have 24 hours after
    date for a check. Thanks for taking the time i hope some one can help me out. Dont warry about it
    if you dont have some thing already made. ....
  12. Php/mysql Search Engine Help
    Having issues displaying results (1)
    I've been using a tutorial
    (http://www.devarticles.com/c/a/MySQL/Developing-A-Site-Search-Engine-With-PHP-And-MySQL/) at this
    address to help me get started on building my own search engine. I've completed the tutorial but
    when I run the search, I get no results on the results page. I'm wondering if anyone will take a
    look at this script and see if they can figure out why my I'm not getting any results displayed.
    I'm using phpMyAdmin to build the database and simple notepad to build the PHP script. CODE
    $submit = $_POST ; $keywords = $_POST ; ....
  13. Phpbb V2.0.16 Has Been Released
    Release Date 06/27/05 (4)
    QUOTE phpBB Group announces the release of phpBB 2.0.16. This release addresses some bugfixes
    and one critical security issue. http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=302011 ....
  14. Question About The Date() Function In Php
    (4)
    Hi this is the code I've been using. This works perfectly fine with mysql but I'm having
    trouble with getting the exact time. It probably has something to do with time zones and countries.
    Is there something that I need to set to get the time right? I'm from the Philippines and we
    have the same time as Singapore and HongKong. Help please. Tnx. /huh.gif' border='0'
    style='vertical-align:middle' alt='huh.gif' /> CODE $date = date('H:i A, jS F Y');
    ....

    1. Looking for displaying, date, time, gmt, 8,

Searching Video's for displaying, date, time, gmt, 8,
See Also,
advertisement


Displaying Date And Time (gmt+8)

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com