469,923 Members | 1,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

converting date format

Hi,

I have an issue regarding the php date format. I choose the date from date-picker which is in the format date('Y-m-d') i.e. 2008-09-12, then I will store this date in the variable $date_id and send this date to different php pages and I need to print the date from $date_id variable in the format date('d F Y') i.e. 12 september 2008. How can I do this using php date functions

WIth regards
Mar 6 '08 #1
4 4195
hsriat
1,654 Expert 1GB
Hi,

I have an issue regarding the php date format. I choose the date from date-picker which is in the format date('Y-m-d') i.e. 2008-09-12, then I will store this date in the variable $date_id and send this date to different php pages and I need to print the date from $date_id variable in the format date('d F Y') i.e. 12 september 2008. How can I do this using php date functions

WIth regards
Use gmmktime() to convert your time to Unix time stamp format.

See this tutorial.
Mar 6 '08 #2
ronverdonk
4,258 Expert 4TB
This will do it [php]<?php
$date_id='2008-09-12';
echo date('d F Y', strtotime($date_id));
?>[/php]result
Expand|Select|Wrap|Line Numbers
  1. 12 September 2008
Ronald
Mar 6 '08 #3
Thank you ronverdonk for your help,
It is working
Mar 7 '08 #4
ronverdonk
4,258 Expert 4TB
Glad it worked. See you again in the forum.

Ronald
Mar 7 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Alok yadav | last post: by
5 posts views Thread by c_shah | last post: by
3 posts views Thread by zshenk | last post: by
3 posts views Thread by Jef Driesen | last post: by
18 posts views Thread by Dirk Hagemann | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.