Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-06-2012, 12:44 PM   PM User | #1
needsomehelp
Regular Coder

 
Join Date: Oct 2009
Posts: 309
Thanks: 4
Thanked 3 Times in 3 Posts
needsomehelp can only hope to improve
converting DD-MM-YYY to time

Can anyone please tell me how I convert DD-MM-YYY (text) to TIME (unix)

thought I'd say that I have this line at the top of all my pages, just in case it means a different code.

Code:
date_default_timezone_set('Europe/London');	//### Set the default timezone
needsomehelp is offline   Reply With Quote
Old 01-06-2012, 02:52 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
d-m-y is a valid gnu format. Use
PHP Code:
$timestamp strtotime('1-1-2012'); 
If its already in SQL you can call the databases method of conversion. MySQL uses UNIX_TIMESTAMP that should accept a valid datetime type in SQL.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:01 PM.


Advertisement
Log in to turn off these ads.