By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,968 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,968 IT Pros & Developers. It's quick & easy.

displaying current date and time in php

Paul NIcolai Sunga
P: 43
hi to all, could i ask what method will i use to display the current date and time in a browser?..thankz





regards,

Paul Nicolai Sunga
Oct 16 '08 #1
Share this Question
Share on Google+
5 Replies


chelvan
P: 90
hi
welcome
its simple

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. date_default_timezone_set('UTC');
  3. date("F j, Y, g:i a");
  4. <?
  5.  
i think its may your answer.

regards
chel-1
Oct 16 '08 #2

chelvan
P: 90
hi
welcome
its simple

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. date_default_timezone_set('UTC');
  3. date("F j, Y, g:i a");
  4. <?
  5.  
i think its may your answer.

regards
chel-1

or you can use this

date("l, F d, Y h:i" ,time());

chel-1
Oct 16 '08 #3

Paul NIcolai Sunga
P: 43
thankz... i'll try..




regards,



Paul Nicolai Sunga
Oct 16 '08 #4

Dormilich
Expert Mod 5K+
P: 8,639
or you can use this

date("l, F d, Y h:i" ,time());

chel-1
which is essentially the same as

date("l, F d, Y h:i");

regards
Oct 16 '08 #5

pbmods
Expert 5K+
P: 5,821
Heya, Paul.

For a list of what all those letters mean, check out the PHP Manual page for date() (http://php.net/date).
Oct 16 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.