a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Standard Dates

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Standard Dates
Page: [1]
 
James D.

 

Posts: 2
Joined: 12/5/2006
Status: offline

 
Standard Dates - 12/5/2006 11:12:12   
The last two days Ive been reading into the PHP FAQ to solve my problem with Dates, but I cant seem to find any info there or in the nettalk forums that resolve my problem. Basically I want to fetch the current date in this format Day, Month, Year and insert it into my DB then fetch the info later on and display it like Day, Month, Year. Up till now Ive used Unix Timestamps, but well I dont need the exact minute or hour for this project and the Unix Timestamp uses just that.

Ive used the Date function to get the date, but cant insert the Variable with the date into my database. The column type is currently set at Date.

Thanks for any help.

<no sigs>

< Message edited by Spooky -- 12/6/2006 19:14:00 >
Tailslide

 

Posts: 6368
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Standard Dates - 12/5/2006 12:06:54   
I'm no PHP expert (she says prefacing her answer just in case...) but from what I know you have to store dates in the format yyyy-mm-dd. You can then use PHP to format that however you like - this is an excerpt from a PHP/MySQL script I used:

$result = @mysql_query("select id, DATE_FORMAT(newsdate, '%d-%m-%Y') AS newsdate, newssummary from archive ORDER BY id DESC");


From which you can probably get the general idea.

Does that help at all?

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to James D.)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> Standard Dates
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts