473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem while using datediff function

25
Hi,
I am using datediff() function to get difference between two dates.
my code looks like,
Expand|Select|Wrap|Line Numbers
  1. function dateDiff($dformat, $endDate, $beginDate)
  2.     {
  3.          $date_parts1 = explode($dformat, $beginDate);
  4.          $date_parts2 = explode($dformat, $endDate);
  5.          $start_date  = gregoriantojd($date_parts1[1], $date_parts1[0], $date_parts1[2]);
  6.          $end_date    = gregoriantojd($date_parts2[1], $date_parts2[0], $date_parts2[2]);
  7.  
  8.          return $end_date - $start_date; 
  9.     }
  10.  
this gives error as "Warning: gregoriantojd() expects parameter 2 to be long"
but problem occurs for particular dates only not for all.
What should i do to overcome this. can you please give me helping hand.

Thank you in advance.
Mar 6 '10 #1
2 1906
zorgi
431 Expert 256MB
What dates this problem occurs for?
Mar 6 '10 #2
bandy
25
Hi zorgi,
I got my solution, on datediff(). thank you for reply.
Mar 8 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: CJM | last post by:
I have an ASP page that lists files and folders in a directory. I'm using a cookie to record the last time this page was visited, and I intend to show links that are created/modified from that date...
19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
by: intl04 | last post by:
I'm trying to set up a query that will include a new field ('Days until completion') whose value is derived from the DateDiff function. I think I have the syntax correct but am not sure. Days...
6
by: Mark Reed | last post by:
Hi Guru's, I have created a database to monitor hours I have worked as our payroll department are so crap. I work nights most of the time but occasionally I have to work on days. Between the hours...
0
by: Kamyk | last post by:
Hello all! I have problem with code. Firstly I have created the VBScript code which count me the time and days which left to the end of working week. I work from 8:00 am till 4 pm. I would like...
1
by: John T. | last post by:
I have two date fields: InitialDate InspDate I've tried to use a Datediff expression within an IIF function (see below) in an unbound textbox to give me the amount of days elapsed between...
1
by: jdubu0 | last post by:
I have an MS Access query that I was hoping to summarize on the Tenure field but, instead, the rows are created as if the Tenure field were an Employee ID. So I have duplicate Tenure fields when I...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
17
by: radio1 | last post by:
Configuration: Access 2002 and SQL Server 2000 using a .ADP Project. I would VERY MUCH appreciate anyone's input into this problem I'm having. I have a form in Access that does not permit...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.