Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-22-2007, 05:35 AM   #1
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Rep: Reputation: 30
find YYYYMMDD and YYYYMMDD difference

does any body now any such algorith either Java or python implemented? to find difference in days from YYYYMMDD to YYYYMMDD?
Or just an algorithm, that converts YYYYMMDD to seconds since the epoch(either Java or python implemented)?

Old 09-22-2007, 11:37 AM   #2
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
Python has it built-in:
pu@slackw:~$ python
Python 2.5.1 (r251:54863, May  4 2007, 16:52:23)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> a=datetime.datetime(2007,9,22)
>>> b=datetime.datetime(1967,5,19)
>>> a-b
>>> (a-b).days


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find with -exec argument - not giving proper to find... hinetvenkat Linux - Server 4 01-25-2010 07:19 AM
Make,find difference between Enterprise Servers and choose snitoor Linux - Server 1 06-07-2007 11:15 AM
Wat is main difference between find and locate command. rktech83 Linux - General 1 03-08-2006 08:38 AM
reqd to find the difference between two files Prasun1 Linux - General 7 09-09-2005 06:16 PM
How can i find the difference for directory alice95089 Linux - Software 4 02-07-2005 09:49 AM

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration