Jump to content
xisto Community
contactskn

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
http://uk3.php.net/manual/en/function.date.php



Nice N Easy :(

From the php site:

<?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));
?>


Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.