The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> 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
 
Reply to this topicStart new topic
Replies
Sparkyg
post Oct 14 2006, 06:21 AM
Post #2


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

Posts in this topic
cookie mutza   mysgl   Oct 13 2006, 03:06 PM
cookie mutza   and how i can call them through php   Oct 13 2006, 03:08 PM
Sparkyg   Hi There To display dates from mysql, a couple of...   Oct 14 2006, 06:21 AM


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: 16th April 2024 - 03:56 PM