Nov 22, 2009

How Can I Display The Current Date And Time On My Website.

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

How Can I Display The Current Date And Time On My Website.

contactskn
Dear friends
I want to display the current date and time on my website. How can I be able to do that. What is the code for the same. Can I display this date and time in any other language other than english like hindi etc. in unicode or any other language. Please do help me with codes.
Thanks in advance.

Comment/Reply (w/o sign-up)

freeflashclocks
The best option for you to insert date and time on your web site is for you to use a web calendar and a web flash clock.

Of course you can insert a date and time script on your website, but with the flash clock fashion this days, everyone is getting a free flash clock on web sites that offer them for free, for example, i have a popular web site where i offer really professional and cool flash clocks for free, you can download and use on your web site or blog.


My web site about flash clocks, in fact is a blog, you can find what you want there at no cost.

If you want to insert a script in your web site to show date and time, well, you can search free scripts web sites for free date/time scripts programmed in php and javascript, but it is much more cool to use a flash clock, you decide however.

Comment/Reply (w/o sign-up)

shadowx
http://uk3.php.net/manual/en/function.date.php



Nice N Easy biggrin.gif

From the php site:

QUOTE
<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('UTC');


// Prints something like: Monday
echo date("l");

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

/* use the constants in the format parameter */
// prints something like: Mon, 15 Aug 2005 15:12:46 UTC
echo date(DATE_RFC822);

// prints something like: 2000-07-01T00:00:00+00:00
echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));
?>



 

 

 


Comment/Reply (w/o sign-up)

contactskn
Dear friends thank you very much for the suggestions but I would basically want to show the date and time in Hindi using unicode fonts is it possible please help me friends.

Comment/Reply (w/o sign-up)

jlhaslip
What character set is defined for your page? Is it UTF-8 or Hindi?

Comment/Reply (w/o sign-up)

Unparallelogram
I'm not sure about the details, but php lets you set locales and then format things in such the locale. You should first call setlocale() to tell php what language to use for its outputs, including date formatting, then call strftime(), which gives a formatted time string. See for details:

http://uk3.php.net/manual/en/function.setlocale.php
http://uk3.php.net/manual/en/function.strftime.php

Comment/Reply (w/o sign-up)

contactskn
QUOTE (jlhaslip @ Jun 15 2009, 03:24 PM) *
What character set is defined for your page? Is it UTF-8 or Hindi?



Dear friend it is Hindi

Comment/Reply (w/o sign-up)

iworld200
QUOTE (Unparallelogram @ Jun 19 2009, 02:59 AM) *
I'm not sure about the details, but php lets you set locales and then format things in such the locale. You should first call setlocale() to tell php what language to use for its outputs, including date formatting, then call strftime(), which gives a formatted time string. See for details:

http://uk3.php.net/manual/en/function.setlocale.php
http://uk3.php.net/manual/en/function.strftime.php


in php is it possible to display the servers date instead of the systems default date in local language?

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 :

  1. Php Date()?
    timezone is offset (4)
  2. How To Display Images Of A Directory
    (5)
    I am trying to do a simple thing. I want to display all the images of a directory on a single page
    with the checkbox next to each image, so that i can select multi images and i can delete selected
    images. Following few lines of code display the images of a directory.. i need help to put the
    check boxes with each image. and I dont understand how can i select multi images with check box and
    then delete them. I hope someone can help. thanks. CODE $path = "./"; $dir_handle =
    @opendir($path) or die("Unable to open folder"); while (false !== ($file = readdir($dir_han....
  3. Displaying Date And Time (gmt+8)
    (5)
    how to display date and time (gmt+8)? any help would be appreciated.....
  4. Creating A Login Box That Links To My Phpbb Forum
    Have my phpBB Forum Intergrated with my Website (4)
    Can someone please give me a code that I can use to put a login box on my website, that will login a
    user into my phpBB Forum? Sort of like Having my phpBB Forum Intergrated with my Website? Thank you
    so much if you can! /angel.gif" style="vertical-align:middle" emoid=":angel:" border="0"
    alt="angel.gif" /> Ex. ....
  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. How To Display The Latest Forum Post On Main Page
    (4)
    Hey does anyone know how to display the latest forum post on the main page of a website? I'm new
    to PHP and have no idea what to do. Thanks in advance!....
  7. 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. ....
  8. Updating Website From Another -- Website
    Is it possible, and how? (7)
    i was just thinking about this project that i'm doing, and i thought that it would be a good
    thing that i could update my website let's say on trap17 from my localhost computer with a click
    of a mouse, without all of that ftp mambo-yumbo the thing is that i wanted an "UPDATE" button on my
    site which woud connect to my localhost and update all the things needed. let's say i added few
    profiles localy, and i want to update them on site.. how could it be done. if i was crude in
    explanation please write what info u still need and i'll post it back.......
  9. Help With Some Website Coding
    Databases and saving form results (4)
    Hey all, I was looking for some help with creating my new website. I have a form already created,
    with some text areas, checkboxes, drop down menu's, ect. I need some help setting up the code to
    save the form data once the user clicks "Submit" after filling in their information in the form. I
    was hoping to do this 2 ways - 1. Saving the information into some type of database (MySQL I'm
    guessing?) and 2. Have the form results emailed to me. I am familiar with the old way of emailing
    the results by putting "mailto:email@domain.com" into the form, but new browse....
  10. 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....
  11. Display Random File In A Directory
    how to display a random file from a set directory. (9)
    hi, could someone please help me with this? I have some files in a directory and i want to know how
    i can randomly display link/s to one or more of the files in my directory for download. But it must
    not at any time display index.php which is also in the directory with the downloads. Thanks in
    advance for any help given /unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0"
    alt="unsure.gif" />....
  12. Display MySQL results in a Table
    question (8)
    hi all i know php and my sql i want to know how can show mysql result in this tabel for example :
    CODE                    1          8                    2          9          
             3          10                    4          11                    5          12
                       6          13                    7          14      this table
    show result in 2 columns . Is it imposible to show result in this tabale with 1 query ? Just paste
    query here thanks all ....
  13. Question: Securing A Website For Beginners
    (1)
    I don't really understand 'bout it. What kind of security we have to make to hold our web
    secure. Only log in features? how bout 'deface' method? how does it work? thx in advance
    Please use detailed topic title. ....
  14. How I Can Display Forum Topic On Main Website ?
    (4)
    Suppose i have a website.. domain.com , and have phpbb forums on domain.com/forums.. And i want to
    display the new topics written in the forum on the main page of website...how i can do that.. ? for
    example ,I want to display this topic `? "domain.com/forums/viewtopic.php?t=16" how can i do that ?....
  15. Sending Messeges Over A Website.
    (3)
    i want to learn how members of a website can send messeges to each other using php since im learning
    it. okay i can write in more detail..that for example if users can register on a website , suppose
    there are some users on the website , and now i want to learn how they can send messeges to each
    other.suppose each user has a unique ID ... and for example if some one has send the messege to
    other member of website , then he can know that he has recieved a new messege..something like inbox
    on the website where all of his messeges can be stored...lets say same way like on t....
  16. <textarea> Tag Is Not Accepting Php Variable
    for display, although <Input> tag does accept it (2)
    I have a single page template which has a Form on it. Logic is to check for a valid Querystring and
    place the variables accepted from a form back into the form and re-display this form with error or
    acceptance messages. I'm sure everyone here has done this a million times. The Form accepts
    data from a user for First name, Last name, email address, and message-body named
    'note_wide' then re-displays the values into the Form, but for some reason, I can't get
    the value to display into a Textarea. Sample of the php code is as follows: first the good one:....
  17. 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. ....
  18. Can My Forum And Website Use The Same Profiles?
    (3)
    I've been programming a 'rate-em' site from scratch. You know like Hot Or Not. YEs,..
    yet another rate-em website. Anyway, i'ts done and before I launch it I need to add a forum as
    the finishing touch, but all the forum softeware out there seems so hard to integrate. I'm
    trying to make it so that when a user logs into my rate-em website they are also logged into 'my
    forum'. i.e. i want my forum and web site to use the same profile data. If anyone knows of a
    forum program made for this objective please let me know. I'm in over my head, a....
  19. Music Website
    (3)
    http://www.metalmania.net I'm pretty much a novice when it comes to php/mysql and I have been
    trying to figure out how to build something similar to the way the site above works. Do any of you
    know of a tutorial or script or something that would show me how to accomplish something very
    similar to that? I have also been exploring phpnuke platinum with the TopMusic mod, but it just
    doesnt want to do what I want it to do. Sure it has a lot of features already done for me, but the
    architecture and navigation is very poor in my opinion, not nearly as efficent as the n....
  20. Free Website Portal
    (2)
    hey everyone, have you ever used PHP??? well if you have you know how cool it is and nice to work
    with and it has nice mods and stuff for it.... well i got the ultimate php its called
    PHP-Platinum very very very nice Portal and Engine Coding, slick sleek and smooth are 3 words for
    this portal... if you want to see it in action and see features of it or even download it and check
    it out for yourself visit this site PHP-Nuke Platinum Features & Downloads its a very nice
    thing to use so go check it out, i love it cause its got nice protection so your site stays s....
  21. Website Help
    Need php programmers to help me. (10)
    I need some php programmers help. I am working on a website. I have asked for some code in another
    topic and would now like help. These will possibly be sold. And if they do I am willing to pay the
    people who help me out a lot some of it. Dun start asking to help and like help a tiny bit and
    expect to get something big out of it. I am only paying to people who help a lot and once they are
    sent out. You must also be good with making clan websites. These will be for clans. If you bother me
    about getting money than no pay. More info on aim. My aim is generalds2001....
  22. 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 ....
  23. Php Website Assistance?
    Help Me (1)
    Hello, i have just set up a website, and want to protect the site using login and password
    protection. Can anyone give me some PHP scripts which will keep a track of usernames and passwords,
    and add them to the access rights list. is this possible? If so, i would be much obliged if you
    would do so. Thank you. P.S If anyone needs assistance with HTML, that is my speciality, so send
    me a message. Always happy to help....
  24. Script: Phpbb Mod, Total Users Registered
    Display the total users anywhere on your site. (1)
    This is for phpBB V2+ It displays the total number of registered users anywhere you want. This file
    is called: phpbb-totalusers.php CODE /** * ©2005 Craig lloyd. All rights reserved. * * Mod
    Title:   Total Registered Users * Author:      Craig Lloyd * Description: Shows total number of
    registered users * Release:     v1.2, 10th May 2005 *** * Demo:              
     http://www.toxicsims.co.uk/ (stats box) * Installation Level:  Easy * Installation Time:   1
    minute * Files To Edit:       This one * Included Files:      phpbb-totalusers.php *** *
    Installation Notes: * ....
  25. Need Help With My Website
    (4)
    Hello, i have Invision Power Board v3, my website is http://www.generatione.trap17.com/forums] , I
    am doing this website for this organization. Anyhow, i still dont have a home page, but i have the
    forum part set up. And that is what i need some help on. and i had a couple of questions in which i
    was wondering if you guys new how to change these settings. How can i change the title of my
    website? The current one is New Directions - Forum (Powered by Invision Power Board). How can i
    put more links in for example in trap17 there are , i was wondering how could i ....
  26. 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');
    ....
  27. Links To Lots Of Usefull Website
    I AM NOT SPAMING THIS TOOK ME 15 MINUTES (2)
    HELLO HERES A LIST OF LOTS OF USEFULL SITES I FOUND: || Codecs || http://www.free-codecs.com
    http://www.codecsdownload.com http://www.freecodecs.net http://www.click-now.net
    http://www.click-now.org || Search Engines || www.google.com www.search.com www.altalavista.com
    www.AllSearchEngines.com www.mamma.com || Programming Help Sites || www.patorjk.com
    www.planet-source-code.com www.freevbcode.com www.codearchive.com www.vbaccelerator.com
    www.vbcode.com www.abstractvb.com www.developerfusion.com www.codeproject.com www.extreme-vb.net ||
    Free Online Game Play || ....
  28. Website Made With Php
    help... (31)
    I want to create and interactive website, similar to ' Free Web Templates ' I do not have
    the knowledge to create such a website where users sign up, login, and have profile pages, also
    pages displaying their contributions.... If someone could create a base for this website for me,
    e.g, login page, mambers page, profile page, creations page and so on... which I can then change the
    layout and so on to suit my needs... I can off a small amount of money for this, however, not alot.
    Any response is welcome, Thank you, Craig.....
  29. Very Good Php Website
    Informations about php editors (10)
    Just go here: http://www.php-editors.com/ ....
  30. I Want A Php Code To Display The Most Popular...
    (6)
    I want a PHP code to display the most popular clicks/links on certain pages. Can anyone help?....

    1. Looking for How, Can, I, Display, The, Current, Date, And, Time, On, My, Website.
Similar
Php Date()? - timezone is offset
How To Display Images Of A Directory
Displaying Date And Time (gmt+8)
Creating A Login Box That Links To My Phpbb Forum - Have my phpBB Forum Intergrated with my Website
Php Date() Problem [resolved] - date() seems to loop same ninute.
How To Display The Latest Forum Post On Main Page
Display The Current Date/time - With a simple PHP code
Updating Website From Another -- Website - Is it possible, and how?
Help With Some Website Coding - Databases and saving form results
Simple Php Calendar And Yahoo! Calendar Connection - linking each date to Yahoo! calendar
Display Random File In A Directory - how to display a random file from a set directory.
Display MySQL results in a Table - question
Question: Securing A Website For Beginners
How I Can Display Forum Topic On Main Website ?
Sending Messeges Over A Website.
<textarea> Tag Is Not Accepting Php Variable - for display, although <Input> tag does accept it
Adding One Day To Date - i'd like to add one day to date
Can My Forum And Website Use The Same Profiles?
Music Website
Free Website Portal
Website Help - Need php programmers to help me.
Phpbb V2.0.16 Has Been Released - Release Date 06/27/05
Php Website Assistance? - Help Me
Script: Phpbb Mod, Total Users Registered - Display the total users anywhere on your site.
Need Help With My Website
Question About The Date() Function In Php
Links To Lots Of Usefull Website - I AM NOT SPAMING THIS TOOK ME 15 MINUTES
Website Made With Php - help...
Very Good Php Website - Informations about php editors
I Want A Php Code To Display The Most Popular...

Searching Video's for How, Can, I, Display, The, Current, Date, And, Time, On, My, Website.
See Also,
advertisement


How Can I Display The Current Date And Time On My Website.

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