Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2004, 05:04 PM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help on date field mask

Is there any way to get the date from a field mask (e.g. [ / / ])? Since I can't do this in HTML, I'm assuming I can't do this in PHP either. Right now I have 3 separate <input> fields to get the month, day, and year. Then I put them together with MKTIME. Coming from VB this seems a bit archaic, but...

Any suggestions?

TIA

 
Old December 16th, 2004, 10:10 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

If you put them together with mktime() that creates a timestamp.

You can extract the date from a timestamp with the standard date() function like this:

date("date format",$timestamp);

Or if you just join the three fields, I believe you can just use strtotime(). Check the PHP manual for more information.

-Snib - http://www.snibworks.com
Where will you be in 100 years?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a Date field based on another field arholly Access VBA 6 November 22nd, 2006 11:19 AM
putting a date into a date field elladi Classic ASP Databases 2 March 31st, 2005 01:30 PM
Date Field from Parameter Field narooma.12 Crystal Reports 0 November 14th, 2004 08:51 PM
DTS Import ( Date string to Date field) gfowajuh SQL Server 2000 1 September 30th, 2003 06:28 AM
Date Field costrega Classic ASP Databases 2 September 16th, 2003 02:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.