Jump to content

retrieve date and time from mysql field using strtotime


bickyz

Recommended Posts

hi i have a mysql table with upddate and updtime field as follows:

upddate      updtime

2011-02-25  11:03:05

2011-01-28  08:01:09

2011-02-20  07:00:08

2011-02-15  06:10:02

2011-02-05  10:21:04

2011-02-09  10:20:25

 

the data types for upddate is mysql date and for updtime its mysql time

 

In my php page i use

<?php echo $date = date("d M Y",strtotime($row_rs1['upddate'])); ?>

to retrieve date and the results displays as 25 Feb 2011. And for time right now im using

<?php echo $row_rs1['updtime']; ?>

which displays time as 11:03:05

 

I want to display time as HH:MM only, how can i do it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.