6

Conversion of August 7, 2012 to date format php

 2 years ago
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.
neoserver,ios ssh client

Conversion of August 7, 2012 to date format php

advertisements

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

I have the following type of Timestamp in a CSV File with several thousand lines: Oct 1, 2014 - 06:22:25 Now I know that I can extract the data using formulas, and that I could theoretically do so in VBA as well. However, this seems like a rather mes

Date format PHP / Date (1365004652303-0500) /

I am calling an API from where I am getting date /Date(1365004652303-0500)/, I don't understand what format this is. How is this date format called? I was not sure what to google for such type of format. Can anyone help me out in getting this date in

Convert the date format of jS \ from F Y D to Ymd in PHP

I have date in the following format 31st of August 2014 Sun using $cursor->format("jS \of F Y D"); but how can I convert the existing time to Ymd so that the output will be 20140831 I tried like echo date("Y-m-d", strtotime(31st of

Changing the Date Format - Incorrect Year

The code: $expiration_date = "24th Dec, 2012"; var_dump( date( 'Y-m-d', strtotime( $expiration_date )));; The output: string(10) "2011-12-24" Why is PHP not parsing the year correctly (showing 2011 instead of 2012)? PHP Version: 5.2.17

Conversion of PHP date formats

I have a date that is currently formatted as 'y.m.d' and I need it formatted as 'D, M d, Y'. I've tried everything I can think of, but it always seems to get confused. Usually, a date that is listed as '11.11.27' comes out as 'Wed, Dec 31, 1969' some

Conversion of the date format of the string for the Date object

I am getting a Date format in String as Output like this. Fri May 18 00:00:00 EDT 2012 I need to Convert this to a Date Object. What approach shall I use? Thank you. This is the program i used. import java.util.*; import java.text.*; public class Dat

Java Date Format Conversion

This question already has an answer here: java.text.ParseException: Unparseable date: "Thu Jan 19 2012 08:00 PM" 4 answers In my android app i need to convert a date from 'Jan 2017,20' this format to '19-1-2017'.The date is selected from the Dat

Date format conversion does not work as expected in Java

this is a well known question already appeared on stackoverflow. I have been asked to solve a bug in a web application. I have a date coming from a web form, the user is supposed to enter a valid date in a given format dd/MM/yyyy. The application is

format of conversion string in date format

I am not able to convert the string to DATE format select CONVERT(DATE, '8/17/2016', 103) Conversion failed when converting date and/or time from character string. what can we do to resolve this thanksActually you don't need that style, It is the one

Changing the date format in SQL Server 2012

I have a SQL Server 2012 Express database that has been installed on a server in Germany. I created a database and have now realised the date formats are incorrect. I need to show each date as dd/mm/yyyy. When I run dbcc useroptions (after making som

Conversion between date formats in PHP

I have a Web for that requires the user to enter a date which is then stored in a MySQL database. I'd like to have the user enter the date in m/d/yyyy and have the system convert it into the Y-m-d format that MySQL requires. I thought that was simple

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

I need to read an excel spreadsheet with date format m/d/y into database. However, PHPExcel is outputting the wrong date because it thinks the date format is d/m/y. How can I tell PHPExcel reader object to use the format m/d/y?If the date is simply a

Date format conversion date is wrong date

This question already has an answer here: Convert one date format into another in PHP 12 answers I tried converting 12-18-1997 to 18-12-1997 with this code $new_date = date('d-m-Y', strtotime('12-18-1997')); but it results in 18-12-1969 If I have to

Conversion between date formats in PHP giving an error

This question already has an answer here: Convert one date format into another in PHP 12 answers database date format that i retrieve is $event_date='2013-01-20'; and i want to convert this format to like this Jan 1,2013 I have tried this echo date('

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK