Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0

    Ddate - Discordian Date Problems


    Hello everyone,

    I just got an email from a friend, and she said:

    Problem: A database conversion to Access took place, performed by a 3rd party. The conversion process left all date fields in a numeric format that doesn't follow any other numeric date pattern. (E.g., The numeric value 102438 is equivalent to 01/06/2000)

    Solution: The only date conversion tool available is a little stand-alone executable, for which we have no source code. (It is zipped up and attached.)

    Question: Do you know of a way to create a program or script that will interact with the executable? There are hundreds of thousands of numeric values in the database that need to be converted using the executable. I can write a program to pull each value from the database, but need a way to pass the numeric value to the executable and retrieve the converted date value so that it can be changed in the database.


    Is there something that would allow her to convert all these "numbers" back into regular dates? Whether it be what she asked for (a way to interact with .exe) or even if it's some other script that would be better or just even functional.

    I have searched Google for quite a while, and found out that the "ddate" program is built-in to many linux os builds, and it is used to convert from Gregorian Calendar(normal) to Discordian Calendar, and had the ability to cross-convert from one to the other. However, when I looked for a script-based converter that I could feed values to, I wasn't able to come up with anything more than a converter for the current day. And even that was not what I wanted. It would convert it to something other than this "number" format of the Discordian Calendar.

    Any assistance that you could provide would be greatly appreciated.

    David
    Attached Files
  2. #2
  3. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    Why not just write a VBA function. With access you can call that function in your queries. If you know the math formula, I could write the function.
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    That's the problem. I don't know how it's calculating the date into an integer.

    Attached are some examples of converters both in PHP and Perl.

    Thanks,

    David
    Attached Files
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  8. #5
  9. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    Originally Posted by davidamarkley
    I have searched Google for quite a while, and found out that the "ddate" program is built-in to many linux os builds, and it is used to convert from Gregorian Calendar(normal) to Discordian Calendar, and had the ability to cross-convert from one to the other. However, when I looked for a script-based converter that I could feed values to, I wasn't able to come up with anything more than a converter for the current day. And even that was not what I wanted. It would convert it to something other than this "number" format of the Discordian Calendar.
    What part of "I have searched Google" did you not understand?

    I spent about three hours reading hits from Google. All to no avail, so I decided to come to a place where smart people were and ask the question.

    I know that there is a ddate windows executable. I attached it in my first post. My problem is that I don't know a way to convert hundreds of thousands of records in an access database using this exe. I know how to get around in VBA, but I am not advanced by any means.

    Any help would be most appreciated, although it would be better appreciated without sarcasm.

    David
  12. #7
  13. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
    Originally Posted by davidamarkley
    What part of "I have searched Google" did you not understand?
    The part in which you found the windows executable ... and for your attachment: I don't download unknown executables from the web because ... you know why.
    Instead of attaching files open up the php script and read it, you'll see that it works just for today because of this line
    php Code:
        $now=getdate();
    make it use an input parameter and you'll have your function (in php), mimic it's logic (quite clear) in any other language and you'll be even happier.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    Yeah, I can understand about executables...

    Thanks for the advice.

    But, here's the problem. I need to convert from Discordian Date (105532) into regular string date (01/28/2006).

    This is the opposite from the files that I've found. Also, while PHP could convert it, I'm not familiar with PHP <> Database communication, and all the numbers are in an access database.

    A VBA function would be obviously the most practical here. If I could find the logic to convert from Discordian Date to Gregorian(Standard) I would probably be a hop, skip and jump away from success, as I could write something in VBA to mimic the logic. However, I can't find it. I looked at the logic in the PHP/Perl files, however, I couldn't see a way to reverse the process(again, not one of my strong points).

    Anybody else have more luck? (Or just perhaps much more knowledge of this?)

    Thanks,

    David

    Comments on this post

    • pabloj agrees : Sorry for the mistake. In the meantime I converted the php function into a mysql function :D
  16. #9
  17. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    Why is anyone even using this for an application? Did I miss something

    The Discordian calendar is an alternative calendar used by some adherents of Discordianism. It is specified on page 00034 of the Principia Discordia.

    The numbering of Discordian years is the same as that of Gregorian years plus 1,166. (Elsewhere in the Principia Discordia, it is mentioned that the Curse of Greyface occurred in 1166 BC, so this is presumably the start-date of the calendar.) The first year is year 0 YOLD (Year of Our Lady of Discord). As a reference, the year Anno Domini 2000 is 3166 YOLD.

    The Discordian calendar has five seasons of 73 days each: Chaos, Discord, Confusion, Bureaucracy, and The Aftermath.

    The Discordian week consists of five days: Sweetmorn, Boomtime, Pungenday, Prickle-Prickle, and Setting Orange. The days of the week are named after the five basic Discordian elements, Sweet, Boom, Pungent, Prickle, and Orange. There are 73 of these weeks per year.

    Every fourth year on the Discordian calendar, starting in YOLD 0002, an extra day is inserted between Chaos 59 and Chaos 60 called St. Tib's Day. This is because 4 years + 1 day = 5, a holy number, but it also conveniently coincides very nearly with the Gregorian leap year. The result of this is that any given day of the year in the Discordian calendar may be taken to correspond to the same day of the year in the Gregorian calendar, and vice versa.

    There are Apostle Holydays on the 5th day of each season, named after the 5 Discordian apostles: Mungday, for Hung Mung; Mojoday, for Dr Van Van Mojo; Syaday, for Sri Syadasti; Zaraday, for Zarathud; and Maladay, for Malaclypse the Elder. There are also Season Holydays on the 50th of each season: Chaoflux, Discoflux, Confuflux, Bureflux, and Afflux.

    The given list of Apostle Holydays is not comprehensive and there may be many more, or many fewer. Discordians are practically forbidden from agreeing on which Apostles are apocryphal and which are canonical; this list is derived from the official Holydays given in the Principia Discordia and may be considered heretical by some Discordians.
    I have yet to find the methodology used to convert Chaos, Discord, Confusion, Bureaucracy, and The Aftermath into integer values, however ... :\
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    Yeah, I sure don't understand why any person in their right mind would use this to store dates? Why cause chaos?

    Thanks for looking at this. I just don't know what to do.

    Again, if anybody has ideas I'm open for suggestions.

    David
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Idaho, USA
    Posts
    7
    Rep Power
    0

    Smile Perhaps an obvious question


    Let me see if I understand you correctly. A 3rd party converted a database, from <please fill in the previous database management system>, to an Access database. You are using Access <please fill in Access Version Here> to access and use the new database.

    Here are a few questions for you:
    1> What is your level of familiarity with Access,VBA and SQL in general?

    2> how did you determin that 1/6/2000 = 102438? I downloaded the PERL utility and I see that 102438 does equal 1/6/2000 using that utility. By the way in the version of Access I'm using, Access 2002 with the database in Access 2000 file format, 102438 is equal to 6/17/2180 and 36531 is equal to 1/6/2000

    3> What results do you get when you run a SQL statement that takes the date integer and insert it into a date field? I created a test database with a table called test. The two field inside of the table are numeric, data type numeric, and date, data type data/time. If you can see where this is going and are board please ignore this line of reasoning. The SQL statement I ran is:
    Update Test set [date]=[numeric];

    4> Can you give some more details about the table structure, database size, and number of records in the table that need conversion?

    On a side note, I just wanted to say that what you are attempting to do isn't so hard, given the database conversion went well. It should be easily solved by either writting the appropriate SQL statement or a simple VBA function that cycles through the table and does the given data manipulation given the proper conversion logic can be determined.
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    Here's a snippet from their database.

    Code:
    102439 
    102442 
    102444 
    102446 
    102481 
    102487 
    102504 
    102517 
    102527 
    102526 
    102527 
    102552 
    102554 
    102568 
    102600 
    102593 
    102593 
    102600 
    102618 
    102637 
    102635 
    102637 
    102643 
    102643 
    102643

    I have sent those four questions to her, CodeRidge, and am waiting for a response.

    I am familiar with modifying advanced queries and VBA code, and am familiar with creating some more simple vba. I'm used to complex queries.

    Email from my friend earlier this morning:

    "It looks like the date fields are all numeric and they all seem to be 6 digits. One suggestion I received from a former co-worker is to use Excel...the numeric date values seem to be exactly 65907 greater than the values I am dealing with, across the board. Right now, my only lead is to look into this...maybe it will work."

    Thanks again for all the input everyone,

    David
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    Here's her answers for you:

    The program was DOS based and I believe that the data came from text files. I am using Access 2000.

    1. I am very familiar with Access, have used VBA (Excel) on occasion, and have a good handle on SQL.

    2. I used the executable to convert the 6-digit number. However, I have learned a few things about the numeric dates this morning: (A) If you go back far enough, some have 5 digits, (B) The dates fall into a 32-day month - the numbers are assigned in that manner. Here is a sample from the conversion program:
    95324 = 2/28/1986
    95325 = 2/29/1986
    95326 = 2/30/1986
    95327 = 2/31/1986
    95328 = 3/00/1986
    95329 = 3/01/1986

    3. I haven't tried this yet, but if I insert a numeric value (E.g., 36531) into a field that is numeric data type, then change the data type to date, the number is converted.

    4. Currently, the tables are look like they are made up of text and numeric fields. The sizes of the two databases are: 685 MB and 435 MB. There are a number of tables in each that have date fields and to make it more fun...some tables have more than one date field. Some of the larger tables have 73,000-78,000 records.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Joplin, MO
    Posts
    15
    Rep Power
    0
    I just got an email from her:

    I discovered that there are 16 months in each year (0-15) and 32 days in each month (0-31), equaling 512 days per year, beginning with 00/01/1800. This is the weirdest calendar I have ever seen. However, now that I have discovered this, I can create a calculation to convert the numeric value to the appropriate date. A little VB program should do the trick.
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Idaho, USA
    Posts
    7
    Rep Power
    0

    Interesting Results


    David,

    This is very interesting indeed. I ran the test data you provided through my test database with the third column subtracting 65907 from the initial value. Here are the results. Do they look about right?

    numeric date mod_date
    102438 6/17/2180 1/6/2000
    102438 6/17/2180 1/6/2000
    102438 6/17/2180 1/6/2000
    102439 6/18/2180 1/7/2000
    102442 6/21/2180 1/10/2000
    102444 6/23/2180 1/12/2000
    102446 6/25/2180 1/14/2000
    102481 7/30/2180 2/18/2000
    102487 8/5/2180 2/24/2000
    102487 8/5/2180 2/24/2000
    102504 8/22/2180 3/12/2000
    102517 9/4/2180 3/25/2000
    102526 9/13/2180 4/3/2000
    102527 9/14/2180 4/4/2000
    102527 9/14/2180 4/4/2000
    102552 10/9/2180 4/29/2000
    102568 10/25/2180 5/15/2000
    102593 11/19/2180 6/9/2000
    102593 11/19/2180 6/9/2000
    102600 11/26/2180 6/16/2000
    102600 11/26/2180 6/16/2000
    102618 12/14/2180 7/4/2000
    102635 12/31/2180 7/21/2000
    102637 1/2/2181 7/23/2000
    102638 1/3/2181 7/24/2000
    102643 1/8/2181 7/29/2000
    102643 1/8/2181 7/29/2000
    102643 1/8/2181 7/29/2000
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo