0

I'd like to format a datetime entry stored in a SQL db in a friendly format.

I'm just returning a simple query as a row(date)...

Is there a quick/easy way to do this?

I can post examples, if need be.

Right now the query is in a foreach loop:

<?php print $row['exp_date']?> 

1 Answer 1

2

You can always use the php date function

Day of the week:

echo date("l", strtotime($row['exp_date'])); // monday 

More complex sample:

echo date("l jS \of F Y h:i:s A", strtotime($row['exp_date'])); // Monday 8th of August 2005 03:12:46 PM 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.