www.php.net/date will show you all the possibilities of formatting the date
bastien
> Date: Sat, 22 Dec 2007 17:54:07 +0600
> From: [EMAIL PROTECTED]
> To: php-db@lists.php.net
> Subject: [PHP-DB] date format problem
>
> my problem is with date format
>
>
> I have a field in my mysql db wich is a timestamp with the format
>
> mmddhhmmss
>
> and I would like to display it like:
>
> dd/mm/
>
http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1333
SELECT DATE_FORMAT(timestamp_col_name, '%d/%m/%Y') FROM table_name
--
PHP Datab
$query = mysql_query("SELECT UNIX_TIMESTAMP(fieldname) AS date WHERE id = '1';");
$array = mysql_fetch_array($query);
$mydate = date("j F, Y",$array[date]);
Change fieldname and the where clause, and that should work.
If you want to further munipulate how it looks, just look at the
dat
ewson
s.utk.edu>cc: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
Subjec
strftime()
offers a lot of formatting options for dates.
Hope it helps.
RUBANOWICZ Lisa wrote:
Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page. However I want to show it as
"2 February, 2003"
or "2 February"
Can someone please help me. The date will not ne
What if
$date="10-02-2002";
I tried it this way and the explode causes problems with the - in it
What would be the best way to deal with this should i just parse out the -?
"Andrey Sosnitsky" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello CrossWalkCent
Hello CrossWalkCentral,
Sunday, September 22, 2002, 7:06:18 AM, you wrote:
Try this
$date= "10 01 2002";
list ($day, $month, $year) = explode(" ", $date);
echo "$year-$month-$day";
C> I am having problems coverting the followign date format. Does any one have
C> any insight on this.
C> $date=
This is how I'd do it:
$strtime = "20020531"; // Example date string
// STEP 1: Turn the MMDD string into a UNIX date
$unixtime = mktime(substr($strtime, 8, 2),substr($strtime, 10,
2),0,substr($strtime, 4, 2),substr($strtime, 6, 2),substr($strtime, 0, 4));
// STEP 2: Use the date() function
on 6/10/02 9:00 AM, fabrizio at [EMAIL PROTECTED] appended the following bits
to my mbox:
> in my mysql-db I have a date_tbl with this format: (20020531).
> how is possible in PHP do display date_tbl's values in a more human-readable
> format like 05-31-2002 or 31/05/2002 ?
In your query, yo
This function will fix your date display.
$sqldate="20020531";
$sqldate= fixdate($sqldate);
function fixdate($data){
$aux="";
$z=0;
for($i=0; $i wrote: Hello dear all,
in my mysql-db I have a date_tbl with this format: (20020531).
how is possible in PHP do display date_tbl's values in a
Monday, June 10, 2002, 2:00:59 PM, you wrote:
> in my mysql-db I have a date_tbl with this format: (20020531).
> how is possible in PHP do display date_tbl's values in a more human-readable
> format like 05-31-2002 or 31/05/2002 ?
Look at date and strtotime...
http://www.php.net/date
http:/
Hi,
You could try to change date("m") to date("n"), and date("d") to date("j").
It looks that sometimes mktime() doesn't remove the trailing zeroes and
returns totally different dates.
The other thing you could try is
$date = date("F dS, Y g:i:s A", date("U")+18000);
this one takes the number se
try "H" as your hour format (date("H")+5)
although out of interest, at 9:51am, using either "g" or "H" gives me 2:51
pm
HTH
/beau
// -Original Message-
// From: Matt Nigh [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 28 November 2001 9:48 AM
// To: php-db
// Subject: [PHP-DB] date for
Hi CK,
I always fetch the Date like "SELECT UNIX_TIMESTAMP(Timestamp) AS Timestamp"
so you can manipulate it with all the PHP Date- and Timefunctions like
date(). So you can display the date the way you asked with:
$Timestamp = ; // fetch the Timestamp the way you like =8)
echo date( "d-m-Y", $
That should do it =>
Good luck!
Ben
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of system
Sent: Friday, July 13, 2001 8:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Date Format
Friends,
I have a design, up and running scripts connected to MySQL.
Ho
Hi
Have a look in Books Online - the e-docs for MSSQL - search for the convert
function and all will be revealed.
Peter
- Original Message -
From: "Jack" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 5:49 PM
Subject: [PHP-DB] Date format in MSSQL
> How I can
16 matches
Mail list logo