The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Days difference between two dates Data469 Shell Programming and Scripting 6 03-26-2008 03:32 PM
compare dates ragha81 Shell Programming and Scripting 2 11-01-2006 06:17 PM
How to get the difference between dates?Can i treat as string? EDBGSK Shell Programming and Scripting 3 10-25-2006 12:18 PM
Difference between two dates in no of days ??? csaha Shell Programming and Scripting 1 01-13-2006 06:44 AM
Searching between dates Khoomfire Shell Programming and Scripting 9 08-22-2005 11:11 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-03-2006
rajus19 rajus19 is offline
Registered User
  
 

Join Date: Feb 2005
Location: Bangalore
Posts: 36
Difference between two dates...

Hi All,
Wish you a Happy New year...

I have to find the difference between two dates, the result should be the number of days. I have seen the "datecalc" function. Its good, can I have any other alternative.

Thanks in Advance
Raju
  #2 (permalink)  
Old 01-03-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by rajus19
I have seen the "datecalc" function. Its good, can I have any other alternative.
Why re-invent the wheel again ?

Search through Yesterdays Date/Date Arithmetic
  #3 (permalink)  
Old 01-04-2006
rajus19 rajus19 is offline
Registered User
  
 

Join Date: Feb 2005
Location: Bangalore
Posts: 36
Logic behind date2jd function??

Thanks for the response.
Can you pls explain the part of logic behind date2jd.

((standard_jd = day - 32075
+ 1461 * (year + 4800 - (14 - month)/12)/4
+ 367 * (month - 2 + (14 - month)/12*12)/12
- 3 * ((year + 4900 - (14 - month)/12)/100)/4))
((jd = standard_jd-2400001))

Regards,
Raju
  #4 (permalink)  
Old 01-04-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Perderabo picked up the algorithm from the internet.

Googling gave me this - Julian Day Numbers

Read through 9.Conversion Algorithms. That should answer your question.

Vino
  #5 (permalink)  
Old 01-04-2006
rajus19 rajus19 is offline
Registered User
  
 

Join Date: Feb 2005
Location: Bangalore
Posts: 36
Thanks Vino
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0