How to convert string to DATE in PHP ?
format Y-m-d
Input from Textfield 2009-11-16
Thank You
Hiring! บริษัทที่น่าสนใจ
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand
<?php $input =
aimakung Mon, 16/11/2009 - 10:28
<?php
$input = $_POST['somewhere'];
$date = date('Y-m-d', strtotime($input));
...
Why it shows 1970-01-01 date
btssky Mon, 16/11/2009 - 11:08
Why it shows 1970-01-01 date in MySQL ?
input 2009-11-16
php+mysql สามารถเอา string
Kiss Mon, 16/11/2009 - 11:21
php+mysql สามารถเอา string ที่อยู่ในรูปformat Y-m-d ลงได้ทันทีนิครับ
Can you give some example
btssky Mon, 16/11/2009 - 12:06
In reply to php+mysql สามารถเอา string by Kiss
Can you give some example ...
in that case i got 0000-00-00
หาก mysql ของคุณสามารถเก็บ
Kiss Mon, 16/11/2009 - 13:05
In reply to Can you give some example by btssky
หาก mysql ของคุณสามารถเก็บ 0000-00-00 ได้(หากไม่ได้ต้องแก้ที่ my.ini)
[code]
$input = "0000-00-00"; // Y-m-d
$sql="INSERT INTO
x(x.date) VALUES ('{$input}')"[/code]
you can use this
risc Mon, 16/11/2009 - 13:03
you can use this example
print date('Y-m-d',strtotime('now'));
print date('Y-m-d',strtotime('yesterday'));
print date('Y-m-d',strtotime('+2 weeks'));
date('Y-m-d',strtotime('yeste
btssky Mon, 16/11/2009 - 13:19
In reply to you can use this by risc
date('Y-m-d',strtotime('yesterday'));
RESULT on MySQL is 2009-11-15 .... NO problem
$input = "2009-11-16"; // Y-m-d
$phpdate = date('Y-m-d',strtotime('$input'));
RESULT on MySQL is 1970-01-01 ????? what happened ?????
what's your SQL query and the
ipats Mon, 16/11/2009 - 13:42
In reply to date('Y-m-d',strtotime('yeste by btssky
what's your SQL query and the field type?
delete single quote at
supersuphot Mon, 16/11/2009 - 14:15
In reply to date('Y-m-d',strtotime('yeste by btssky
delete single quote at '$input'
$phpdate = date('Y-m-d',strtotime($input));
problem solved !!! so easy !
btssky Mon, 16/11/2009 - 14:20
In reply to delete single quote at by supersuphot
problem solved !!! so easy ! I didn't see it , Thank you!