SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Sep 9, 2000, 09:58 #1
- Join Date
- Sep 2000
- Location
- London, UK
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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/
-
Sep 9, 2000, 15:53 #2
- Join Date
- Sep 2000
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Sep 9, 2000, 18:52 #3
- Join Date
- Jul 1999
- Location
- Chicago
- Posts
- 2,629
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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 phpBuilder's code snippet section: http://www.phpbuilder.com/snippet/
-
Sep 9, 2000, 23:56 #4
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
-
Sep 10, 2000, 00:05 #5
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
-
Sep 10, 2000, 06:55 #6
- Join Date
- Sep 2000
- Location
- London, UK
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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/
-
Sep 10, 2000, 11:11 #7
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
Bookmarks