On Tue, Aug 5, 2008 at 11:48 AM, Don Don [EMAIL PROTECTED] wrote:
Hi all,
I've got dates in the following formats e.g.
August 05, 2008, 10:14 am (e.g. today's date)
August 04, 2008, 7:08 am (e.g. yesterda's date)
August 03, 2008, 9:08 am (e.g. in the past)
I am trying to format these
On Tue, Aug 5, 2008 at 11:48 AM, Don Don [EMAIL PROTECTED] wrote:
Hi all,
I've got dates in the following formats e.g.
August 05, 2008, 10:14 am (e.g. today's date)
August 04, 2008, 7:08 am (e.g. yesterda's date)
August 03, 2008, 9:08 am (e.g. in the past)
I am trying to format these
Just have your input form get it in sections, then piece it all together when
dumping it to MySQL
This way you can transparent the code on the front to users, but have it in the
right format in the backend.
Mike Ryan [EMAIL PROTECTED] wrote:
I would like to have my users input the date
On Wed, August 29, 2007 4:12 pm, Mike Ryan wrote:
I would like to have my users input the date formate as mm-dd-
mysql
wants the data to come down as -mm-dd.
The question I have is how do I convert from the mm-dd- to
-mm-dd so
that I can write it out to the database?
You
Use this:
function makedate($format, $indate)
{
$temp = explode(-, $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
$temp = date($format, $fulldate);
return ($temp);
}
and call it with
Just a small question, but why not just do this through the SQL statement
instead of using php?
http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1295
[from the mysql manual]
mysql SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
- 'Saturday October 1997'
mysql SELECT
Use DATE_FORMAT() in your query, or UNIX_TIMESTAMP() to pull it out as a
unix timestamp and use date() in PHP to format it.
Chapter 6, Date and Time Functions in the MySQL Manual has the syntax for
each of the MySQL functions.
---John Holmes...
- Original Message -
From: Clint Tredway
MYSQL will do all the formatting that you need. Look up sect 6.3.4, Date and Time
Functions in mysql manual. Look at the DATE_FORMAT(date,format) command
- Original Message -
From: Clint Tredway [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 11:55 AM
Subject:
thanks for all the replies. I was able to use the date_format() from MySQL.
Clint
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: Clint Tredway [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, December 13, 2002 1:13 PM
Subject: Re: [PHP] Date Formatting
MYSQL will do all
I have the following query :
for($i = 0; $i =$num_results; $i++)
{
$row = mysql_fetch_object($result);
echo table width =\100%\ border =\0\ cellpadding = \3\\n
.tr\n
You can save some typing if you just set the bgcolor in the tr, instead of
each td, FYI. Also, align defaults to
To convert from user format to mysql I use:
$training_date=$_POST[training_date];
$training_date=str_replace(-, /, $training_date);//strtotime doesnt seem to work
right if it has 12-25-2002, but does if it has 12/25/2002
$training_date=strtotime($training_date);
On Wed, Jul 10, 2002 at 12:25:08PM -0500, Rw wrote:
01-02-2003
Is there a handy function to convert that to other ways of expressing the
date such as:
01/02/03
$temp = preg_replace('/^(\d{2})-(\d{2})-(\d{2})(\d{2})$/', '\\1/\\2/\\4',
$date);
2003-01-02
$temp =
Try using the DATE_FORMAT() function within your SQL query string...
$query = SELELCT DATE_FORMAT (your_date_column, '%M %d %Y') FROM
your_table;
where:
%M is the month in full text
%d is the numerical day of the month with leading zeros
%Y is the four digit year
Extract the results as
On Monday, December 10, 2001, at 09:35 PM, phantom wrote:
What would be an easy what to format a date value into month day year??
I want to specially display a date stored in mysql in date format
-MM-DD
The manual says: string date (string format, int [timestamp])
I tried
Here, play with this. dtAuctionStart is a MySQL date field, so substitute
your own connection and var.
Have fun - Miles Thompson
Some messing about with dates br
=br
?
echo $dtAuctionStart, br;
echo date (Y-m-d, $dtAuctionStart ), br;
//$strDate = $dtAuctionStart ;
Original message
From: Paul McGee [EMAIL PROTECTED]
Date: Thu, Aug 30, 2001 at 12:13:21PM -0400
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] Date formatting in PHP 3.0
I'm looping through a MSQL db pulling out the dates where I would like to
display the date and then the day of the week. The
Thanks, I knew it was something stupid!
However, the $dy = date (D, $row[0]) doesn't work.
* RZe: [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Original message
From: Paul McGee [EMAIL PROTECTED]
Date: Thu, Aug 30, 2001 at 12:13:21PM -0400
Message-ID:
Original message
From: Paul McGee [EMAIL PROTECTED]
Date: Thu, Aug 30, 2001 at 12:45:49PM -0400
Message-ID: [EMAIL PROTECTED]
Subject: Re: [PHP] Date formatting in PHP 3.0
Thanks, I knew it was something stupid!
However, the $dy = date (D, $row[0]) doesn't work.
/Original message
Reply
Something I almost always do when pulling dates from a mySQL table is
format the date column in the query itself using the mySQL function
DATE_FORMAT()...
At 01:13 PM 4/6/01 +0100, Matt Davis wrote:
Hi I am trying to format a date extracted from my DB. I have run my query
and then have used
You need a UNIX timestamp for the second argument in date() - thus you need
to first convert your $even into a timestamp (number of seconds past 1970).
?
$event = '2001-03-15 24:03:34';
list($date,$time) = explode(' ',$event);
list($year,$month,$day) = explode('-',$date);
At 3:04 PM -0800 2/6/01, Richard Scott Crawford wrote:
Cold Fusion has a wonderful function called CreateODBCDate(), which
takes as an argument any date in just about any format and returns a
standard ODBC date format that you can plug into a database without
worrying about conversion.
Does
21 matches
Mail list logo