Conversion of August 7, 2012 to date format php
source link: https://www.codesd.com/item/conversion-of-august-7-2012-to-date-format-php.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversion of August 7, 2012 to date format php
I'm creating a mobile version of a website. On the normal version we just use a jquery date picker to select the date. I haven't added anything like this yet on the mobile version because It seemed my Iphone was smart enough to realise it was a date field and give you date scrollers.
But after I've selected the date it's coming up at 7 Aug 2012 which raises a few questions for me... is this standard? or am I going to have to code for different date formats coming from different phones?
Would it be best to use a jquery date picker? (I'm not sure this would be very tidy).
What's the best way to convert a date like this into a format that php and my database can handle. I have done a bit of looking around google but haven't found much as of yet.
Try this
<?php
$today = date('Y-m-d', strtotime('7 Aug 2012'));
echo $today;
?>
gives 2012-08-07
You can change its output by altering Y-m-d
in date()
Refer this!
Related Articles
Conversion of time stamp text to date format using VBA
Date format PHP / Date (1365004652303-0500) /
Convert the date format of jS \ from F Y D to Ymd in PHP
Changing the Date Format - Incorrect Year
Conversion of PHP date formats
Conversion of the date format of the string for the Date object
Java Date Format Conversion
Date format conversion does not work as expected in Java
format of conversion string in date format
Changing the date format in SQL Server 2012
Conversion between date formats in PHP
PHPExcel is waiting for the date format d / m / y, but m / d / y entered. How to set the PHPExcel Reader object to use the custom date format for conversions
Date format conversion date is wrong date
Conversion between date formats in PHP giving an error
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK