Page 1 of 1
Date/Timestamp Question
Posted: Thu Mar 04, 2004 10:41 pm
by Pyrite
I am developing a website/software that is going to be used for many years to come, and the site itself is planned to be used on Windows & Unix Servers. So right now I am using timestamps for dates (registration dates, birthdates, etc). I recently found out that Windows cannot make use of timestamps before 1970 or after 2038. So is there another way I can store my dates and still be able to format them. I am using timestamps so I can format them easily with the date function. If I store the date in MySQL in the format YYYY-MM-DD or whatever, is there a way to format it with php? Ideas?
Also, this is a multi-lingual site, and using timestamps allows me to set the right locale for each language so that the date function will format the date using that locale.
Posted: Fri Mar 05, 2004 1:41 am
by Weirdan
try this library:
http://66.102.9.104/search?q=cache:pC9_ ... n&ie=UTF-8
not sure if it supports locale properly (if does it at all).
Posted: Fri Mar 05, 2004 3:17 am
by twigletmac
If you store dates in MySQL then you don't need PHP to format them you can do it with MySQL, do a search on DATE_FORMAT in the MySQL manual.
Unfortunately this doesn't answer the locale issue.
Mac
Re: Date/Timestamp Question
Posted: Fri Mar 05, 2004 4:00 am
by JayBird
Pyrite wrote:I am developing a website that is going to be used for many years to come.....timestamps before 1970 or after 2038.
You think your site is going to be use until 2038? I don't even think the internet as we know it will exist then
Mark
Posted: Fri Mar 05, 2004 4:03 am
by Pyrite
Well, my site isn't just for the Internet man (why the hell does everyone always question my logic?), also using my (lets just call it software instead of a website) software on CD's, DVD's and Flash Drives. My software will be used my hundreds of thousands of people for the next 100 years or more.
Ps. Wierdan to my Rescue (as Usual), that looks like exactly what I need. And I am already using ADOdb, so even better. Just have to test it. It should still work with the current locales, I'll let ya know if it does. Thanks Weirdan!!
Posted: Fri Mar 05, 2004 4:13 am
by JayBird
errr...i was making a light-hearted comment
I'm intrigued as to what this is if they will be using it for the next 100 years.
Mark
Posted: Fri Mar 05, 2004 4:16 am
by Pyrite
I know, it's just that since day one, every thing I need help with that i've posted on these forums, everytime somebody just sits there and questions me on why I would do such a thing, or want to. My job involves a lot of thinking outside the box, and most people don't understand that. I'm not yelling, just perplexed. I appreciate your comments regardless.
Posted: Fri Mar 05, 2004 4:18 am
by JayBird
I think callenging someone logic is a good thing, someone may bring to light something you haven't thought about. Admittedly, i didn't do that.
Anyways.....
Mark
Posted: Fri Mar 05, 2004 4:19 am
by Pyrite
I know, I ought to write up a thread on what my project involves to refer people to when I ask these obsurd questions. Basically, it's a teaching/distance education site, that I also am not just using on the internet, but other mediums like I said. Kinda taking php/html and using them in a way that they weren't intended for.. but it is worth it for me.
Posted: Fri Mar 05, 2004 9:42 am
by Bill H
..for the next 100 years or more.
Sorry, but I have to question that.
Things change. Technology changes. Society changes. Mores change. Everything changes. Even religion changes to some degree.
The world is so different in just the sixty years that I have been alive that I can scarcely recognize it. Teaching instruments that are only 20 years old are so obsolete that we literally laugh at them now.
I recall that when I was in high school it was nothing more than an "interesting coincidence" that the western outline of Europe/Africa and the eastern outline of the Americas were so similar.
I cannot concieve that
anything technological is going to be used "as is" for "100 years or more."
Posted: Fri Mar 05, 2004 9:47 am
by JayBird
Exactly what i was thinking
In fact, i was just reading this snippet from and article i read
Search Pets. Google representative Craig Silverstein offered his bizarre vision of the future of search during one Search Engine Strategies session. In a speech closely resembling a Star Trek episode, he shared his new prediction of search moving towards the existence of search pets hundreds of years from now. These search pets would not necessarily be like a pet dog, but more like "a genetically engineered beast."
Adding to the science fiction, he believes search pets will be able to understand emotions and allow people to search for things that aren't necessarily facts.
Helping increase and enhance communication, search pets will understand the way the world works and the way humans interact. Search pets will be able to determine and untangle what searchers mean politically and socially.
Google Brain Implants? If the search pets aren’t far out enough for you, Silverstein also shared his believe that search function brain implants may be in store in the distant future. Hundreds of years from now, the world of search as we know it will be completely redefined.
"We'll still search for facts," he says, "but in all likelyhood the facts will be contained in a brain implant."
Hmmm… so, how would you feel about having Google implanted into your brain?
I wonder what version of PHP we will be on when they introduce a brain_connect() function.
Mark
Posted: Fri Mar 05, 2004 9:50 am
by JayBird
...Also, another few quotes
Chairman of IBM wrote:In 1943 the Chairman of IBM, Thomas Watson predicted...
I think there is a world wide market for maybe five computers.
Bill Gates wrote:Bill Gates was reported as saying... 640k should be enough for anyone.
This was the size of the memory in the earlier IBM Personal Computers.
Mark
Posted: Fri Mar 05, 2004 3:31 pm
by cyberhawk
On the other hand..

if the tech people of yesterday were abit more like pyrite, we would never have had the y2k <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>... sooo, help him out fellas.. as you've said, you never know what the future will look like.

Posted: Sun Mar 07, 2004 2:27 am
by Pyrite
See, I don't care about all the politics, and all this theory talk. I don't care, I care about php.
Ps. The Adodb Date Library works! Works with later dates in 1901 and on WindowsXP, up till Jan 19th, 2038, so I don't know why that isn't working, the page says dates up to or past the year 3000, but I dunno. I suspect that I'll just cross that bridge when I come to it, after all, in 2038 if Windows is still around, this stupid date bug will probably be fixed. The use of dates prior to 1970 was really critical for me for now.
Setlocale works with dates that were created with adodb_mktime() using the strftime function, but only for dates >= 1970. The ones before, the adodb_date function doesn't seem to consider setlocale, still playing with it though.