Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6960133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:21:47+00:00 2026-05-27T15:21:47+00:00

i am building a small application to calculate employee attendance. A user will check

  • 0

i am building a small application to calculate employee attendance.

A user will check in, his check in time will be recorded in a mysql datetime format, for example

check_in_time 2011-12-16 20:27:20

And when he checks out

check_out_time 2011-12-16 20:27:27

I can do it the conventional way by exploding and doing the subtraction, but am sure Zend_Date has a more efficient way of doing it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:21:48+00:00Added an answer on May 27, 2026 at 3:21 pm

    Obviously my question was not hard to answer, anyhow this is the answer to get the time diff in seconds, then i can handle seconds normally.

    Thanks for the docs @ajreal, i did not look correctly into them.

    public function getTimeInSeconds($dateStart, $dateEnd) {
        $dateStart = new Zend_Date($dateStart);
        $dateEnd = new Zend_Date($dateEnd);
        $new = $dateStart->sub($dateEnd);
        $timeInSeconds = $new->getTimestamp();
        return $timeInSeconds;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a small Android application which will add a cube on user's
Background: I'm building a small application that will be run daily, pulling data from
I am about to begin building a small application for a user to manage
I'm building a small chat application to add to an existing framework. There will
I'm building a small application that will crawl sites where the content is growing
Im building a small application for my employer where hitting a certain keystroke will
Currently I am building a small application that allows a user to sign in
I am building a small web application, where the user is granted the ability
I'm building a small application that highly depends on anonymous user voting on some
We are building a small web application in Rails that will allow clients to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.