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 dates do I can display them like this
Today at 10:14 am (today)
Yesterday
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
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?
--
PHP General Mailing List (http://www.php.net/)
To
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
have you ever had the need to programmatically convert a date()
compatible date formatting string with one compatible for strftime()?
I had this problem recently when I had to l10n an existing app (and
support legacy data - which include date() formatting strings - at the
same time) ... I came up
How can I format a date coming out of a MySQL? I know how to format today's date but
not a date coming out of MySQL. I have looked through the manual, but I must be blind
because I cannot figure it out.
Thanks,
Clint
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
: Friday, December 13, 2002 11:55 AM
Subject: [PHP] Date Formatting
How can I format a date coming out of a MySQL? I know how to format today's
date but not a date coming out of MySQL. I have looked through the manual,
but I must be blind because I cannot figure it out.
Thanks,
Clint
--
PHP General
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 12:55 PM
Subject: [PHP] Date Formatting
How can I format a date coming out of a MySQL? I know how to format today's
date but not a date coming out of MySQL. I have looked through the manual,
but I must be blind because I cannot
: [PHP] Date Formatting
How can I format a date coming out of a MySQL? I know how to format today's date but
not a
date coming out of MySQL. I have looked through the manual, but I must be blind
because I
cannot figure it out.
Thanks,
Clint
--
PHP General Mailing List (http://www.php.net
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
Hi,
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
.td bgcolor = \#ee\ align = \left\$row-id/td\n
.td bgcolor = \#ee\ align = \left\$row-Nombre/td\n
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
Had trouble getting this posed at the newsgroup - will try on the maillist
here:
I have a date field passed in a form like this:
01-02-2003
Is there a handy function to convert that to other ways of expressing the
date such as:
01/02/03
OR
2003-01-02
I know the syntax of the date
:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date formatting
Had trouble getting this posed at the newsgroup - will try on the maillist
here:
I have a date field passed in a form like this:
01-02-2003
Is there a handy function to convert that to other ways of expressing the
date such as:
01/02
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 =
Hi! =)
I'm doing a website that will be using a pay-per-month membership
program. There's a field for 'lastpaid' that holds the date the last
paid (sorry to state the obvious). My questions are these:
1) What would be the best way to format it so PHP can see if it's been
30 days since it was
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 $FormattedDate = date(F y, Y,${StoredDate})
1999-04-15 spit out December
, December 10, 2001 8:35 PM
Subject: [PHP] Date formatting
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 $FormattedDate
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 ;
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 problem is that every
date returns the same day of the week, Wed. I checked the documentation and
it doesn't say anything about the expression only being executed once
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
ssage-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 problem is that
every
date returns the same day of the week, Wed. I checked the documentation
and
it
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
Hi I am trying to format a date extracted from my DB. I have run my query
and then have used the following to get my row data
while ($row = mysql_fetch_array($sql_result)) {
$title = $row["message_title"];
$message = $row["message"];
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);
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 PHP have a similar function? I've looked for one but
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
32 matches
Mail list logo