-
Forgive me for posting, because this is probably really simple, but I can't get it to work!
I'm designing the site so that each user can have their own login and password, which i have done successfully, but now i want to print the current date and time next to their greeting on the front page. I haven't learnt PHP from the basics up (fool that I am), only the bits I have needed to know.
I've tried searching the manual but can't understand how to call the current date and time into a variable and then print the variable. Yes, I am a buffoon! Any help would be really appreciated ;-)
Thanks in advance.
Jon.
**
http://paramedicscience.co.uk/
-
If you check out http://www.weberdev.com php section and then date/time area then I am sure there will be something
there that will assist.
-
Quote:
Originally posted by dolmanboy
If you check out http://www.weberdev.com php section and then date/time area then I am sure there will be something
there that will assist.
Here is the direct URL to the Time & Date section of Weberdev: http://www.weberdev.com/search.php3?...&secondary=PHP
Here is phpBuilder's code snippet section: http://www.phpbuilder.com/snippet/
-
hi
is this what you need?
This produces Year-Month-Day
<?php
$Today=date("Y-m-d");
?>
This produces Day of week, Name of Month, Day of month, hour, minute and ending with AM or PM
<?php
echo("<br><center>");
print(date("l F d h:i A"));
echo("</center>");
?>
If the goal is to read the current date into the data base then check the
tutorial in this site by Kevin Yank. it uses the CURRENT_DATE in one of the input commands in Part 4 and the subsection "inserting data into a data base."
peace ed
-
a slight mod on my post.
replace the $today=date(Y-M-D); with print(date(Y-M-D));
this will cause the date to print, where the provided example sets the string value and does not print out.
thanks ed
-
Everyone, thanks for your help and quick replies! FYI, i've used Ed's print(date("l F d h:i A")); command to produce the output I required, I was trying to use gmdate() to do the same sort of thing but I kept getting errors.
Once again thanks, nice to know there are people out there willing to help!
Jon.
**
Jon Yates
w: http://paramedicscience.co.uk/
-
Always pleased to be helpful.
The BIGGEST (and folks will tell you i am not big on using caps), problem I have is around the date and time..
peace ed