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 6232855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:11:30+00:00 2026-05-24T10:11:30+00:00

I am converting PHP (v 5.2.17)-based reports to SSRS. I’m trying to write a

  • 0

I am converting PHP (v 5.2.17)-based reports to SSRS.

I’m trying to write a query that subtracts dates like the php file does.

The date calculation either matches exactly, or it differs by exactly 3600 seconds

  $timediff=strtotime(date("Y-m-d"))-strtotime("03/29/2007");
  print $timediff;  // 137635200 

  select (trunc(sysdate) - to_date('03/29/2007','MM/DD/YYYY'))*60*60*24 from dual
  -- returns 137635200 - matches


  $timediff=strtotime(date("Y-m-d"))-strtotime("11/23/2009");
  print $timediff;  // 53823600 

  select (trunc(sysdate) - to_date('11/23/2009','MM/DD/YYYY'))*60*60*24 from dual
  -- returns 53827200 - doesnt match - off by 3600

I’ve searched stackoverflow and found the following example which sounds like it (11/23/2009 is a monday, and so is today 8/8, but it doesnt differ in the same way) PHP Strtotime erratic function

My assumption is that the php calculation is wrong, and the oracle is correct.

What say you? 😉

Thanks!

  • 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-24T10:11:31+00:00Added an answer on May 24, 2026 at 10:11 am

    Without seeing the exact values I suspect its because one of them is adjusting for daylight savings and the other is not. Most parts of the world change to/from daylight savings time during march. So in your first example both dates are in the same GMT offset, but in the second (November) they’re not.

    So one of your platforms (probably Oracle) is taking this one hour shift into account and the other is not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to write a php SOAP client that requires the user to
I'm trying to create a PHP based application that allows students from my school
Basically, we have an ASP website right now that I'm converting to PHP. We're
What is the php script for converting a mysql table to text file? I
I am converting a look-up table in PHP which looks like this to JavaScript
How does one go about converting an image to black and white in PHP?
I have some old apps written in PHP that I'm thinking of converting to
I'm working on a PHP-based webapp that has an existing MySQL database where all
I'm making a web based project management application using MySQL and PHP that uses
I have a file format I'm trying to write to using C#. The format

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.