Solved

date to unix_timestamp

Posted on 2014-02-14
4
154 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

920 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

16 Experts available now in Live!

Get 1:1 Help Now