The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> mysgl, mysql date function
cookie mutza
post Oct 13 2006, 03:06 PM
Post #1





Group: Members
Posts: 7
Joined: 13-October 06
Member No.: 426



can anyone tell me anything about mysqls date functions
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
cookie mutza
post Oct 13 2006, 03:08 PM
Post #2





Group: Members
Posts: 7
Joined: 13-October 06
Member No.: 426



and how i can call them through php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Sparkyg
post Oct 14 2006, 06:21 AM
Post #3


Member
***

Group: Members
Posts: 46
Joined: 29-September 06
From: Suffolk UK
Member No.: 270



Hi There

To display dates from mysql, a couple of funtions I use, just pass in the date in your SQL result, the format can be changed to display any format you like

function ConvFromMySQL2($sqldate) {
$format= "d F Y";
$mydate = date($format,strtotime($sqldate));
return $mydate;
}

function ConvFromMySQL3($sqldate) {
$format= "Y-m-d";
$mydate = date($format,strtotime($sqldate));
return $mydate;
}


to use mysql date functions in mysql just stick them in your query


cheers

Sparky
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 01:22 PM