How to convert full date/time to timestamp?

How to find the difference in hrs/min between two time values? This is related to timestamp and datetime in sq?

  • I have a system that collects the time a user checks in, but i need to find if the person is late or not via subtraction from an employee schedule within the db. How do I go about this. How do I turn the timestamp into a time value without the date value, do I extract the checkin deadline from the db and compare them within the app? How do you add or subtract timestamps? Can anyone share any tips and ideas? Thanks.

  • Answer:

    If you're working with PHP you can use the unix time format. Unix time is time measured in seconds since January 1 1970 00:00:00 GMT. You can use standard PHP functions to convert conventional dates and time to unixtime (seconds), do the neccesary math and return the results to 'normal' time and date format. References: http://php.net/time http://php.net/manual/en/function.time.php http://php.net/manual/en/function.date.php The above links include examples! If people know which script language you're using they can give a more specific answer i guess... A lot of other scripting languages have standard functions like those above.

Briar Leech at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.