Solved

date to unix_timestamp

Posted on 2014-02-14
4
151 Views
Last Modified: 2014-02-16
4/21/2012 12:18:56 AM

times in this format

how do I translate to unix_timestamp
0
Comment
Question by:rgb192
4 Comments
 
LVL 28

Accepted Solution

by:
becraig earned 167 total points
ID: 39860713
print strtotime('4/21/2012 12:18:56')
0
 
LVL 27

Assisted Solution

by:yodercm
yodercm earned 167 total points
ID: 39860721
strtotime() will convert any date to a unix timestamp.  The function documentation can be found at  

http://us3.php.net/manual/en/function.strtotime.php
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 166 total points
ID: 39861106
Please, please, please read this article (I'm sure we have talked about this before).  It will answer almost all of your questions about handling dates and times in PHP.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

One of the things you want to be careful about... Dates written with dashes separating the month, day and year may be interpreted differently from dates written with slashes.  You might want to set up some test cases so you can see the difference.
0
 

Author Closing Comment

by:rgb192
ID: 39863599
strtotime thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Re-imbursement Claim System 3 24
How to validate 2 forms at once 8 26
masking php string 4 0
PHP JSON Clean up 5 0
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now