Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

date to unix_timestamp

Posted on 2014-02-14
4
Medium Priority
?
168 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 29

Accepted Solution

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

Assisted Solution

by:Cornelia Yoder
Cornelia Yoder earned 668 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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 664 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

824 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