By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

Date conversion woes

P: n/a
Using either MySQL functions or PHP, how can I convert a date filed in the
format of (varchar)

Aug 10, 1950

to a unix timestamp?

tia
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Raven wrote:
Using either MySQL functions or PHP, how can I convert a date filed in the
format of (varchar)

Aug 10, 1950

to a unix timestamp?

tia


I believe Unix timestamps are calculated as seconds since January 1,
1970. That being the case, you can't convert dates with years prior to
1970 to Unix timestamps.

NM

Jul 17 '05 #2

P: n/a
"News Me" <newsTWOme@pacifierDOTcom> wrote in message
news:10*************@corp.supernews.com...
Raven wrote:
Using either MySQL functions or PHP, how can I convert a date filed in
the format of (varchar)

Aug 10, 1950

to a unix timestamp?

tia


I believe Unix timestamps are calculated as seconds since January 1, 1970.
That being the case, you can't convert dates with years prior to 1970 to
Unix timestamps.

NM

Correct, I just meant to give a representation of a pattern, not the real
data. I found the easy way with PHP. It would be nice if there was a
direct way with MySQL. Thanks.
Jul 17 '05 #3

P: n/a
> Raven wrote:
Using either MySQL functions or PHP, how can I convert a date filed in
the format of (varchar)

Aug 10, 1950

to a unix timestamp?

tia


I use the PEAR package 'Date' to work with dates before 1970.

<http://pear.php.net/package/Date>

JP

--
Sorry, <de*****@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Jul 17 '05 #4

P: n/a
News Me wrote:

I believe Unix timestamps are calculated as seconds since January 1,
1970. That being the case, you can't convert dates with years prior to
1970 to Unix timestamps.


There is no such thing as a negative Unix timestamp?
Mick

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.